Skip to content
Jaak Laineste edited this page Sep 21, 2017 · 16 revisions

Starting from 2.3 release, Nutiteq SDK supports globe map rendering. This is implemented as special render projection. It is simple to use and requires minimal changes in code in most cases. To switch to globe rendering mode, simply specify spherical render projection option:

mapView.getOptions().setRenderProjection(Options.SPHERICAL_RENDERPROJECTION);

Likewise, to switch it off, use:

mapView.getOptions().setRenderProjection(Options.PLANAR_RENDERPROJECTION);

View-specific parameters like focus point, rotation, tilt are carried over the switch.

There are few limitation that may need changes in source code:

  • Sky rendering is not currently supported, backdrop image is recommended instead. Backdrop image can be specified using Options.setBackgroundImageBitmap and Options.setBackgroundImageDrawMode(Options.DRAW_BACKDROP_BITMAP)

Performance optimization

Globe rendering requires considerably more resources that flat rendering. There are few options that may increase performance when switched off:

  • Tile fading (in extreme cases may increase performance up to 2x)

  • Background plane/sphere rendering (may increase performance up to 2x)

  • Tile preloading (has much less impact)

The number of visible raster tiles varies depending on latitude. Near poles tiles are more compressed, thus more textures are needed and performance is somewhat lower.

Suitable tilesets

Most available tilesets use EPSG3857 projection, which works but it has some performance penalty and they do not cover poles. So if possible then EPSG4326 tilesets are recommended.

Here are some MBTiles format tilesets (zoom range 0-5), which are in EPSG4326:

a) From Natural Earth

b) From NASA Blue Marble NG, similar resolution but nicer:

c) Others:

Globe packages

Usage as base layer. Note that projection is EPSG4326 here:

        try {
            MBTilesRasterDataSource dataSource = new MBTilesRasterDataSource(new EPSG4326(), 0, 5, "/sdcard/BlueMarble_WTB_200408_EPSG4326.mbtiles", false, this);
            RasterLayer mapLayer = new RasterLayer(dataSource, 1508);
            mapView.getLayers().setBaseLayer(mapLayer);
        } catch (IOException e) {
            e.printStackTrace();
        }

Notes

  • Zoom bias may need to be set (Options.setTileZoomLevelBias). This is caused by tiles being inflated near equator while being compressed near the poles.
Clone this wiki locally