Skip to content

Upgrading from Nutiteq SDK pre 2.3 to 2.3

Nutiteq edited this page Aug 8, 2014 · 5 revisions

Nutiteq SDK 2.3 introduced data sources and deprecated most built-in specialized raster layers. Starting from SDK 2.4, most deprecated features are removed from the SDK but the old code base can be easily converted to be compatible with both 2.3 and 2.4.

Deprecated raster layers

pre 2.3 specialized raster layer code:

RasterLayer layer = new TMSMapLayer(
  proj, minZoom, maxZoom, id, "http://tile.openstreetmap.org/", "/", ".png"
);

2.3+ default raster layer with data source:

RasterDataSource dataSource = new HTTPRasterDataSource(
  proj, minZoom, maxZoom, "http://tile.openstreetmap.org/{zoom}/{x}/{y}.png"
);
RasterLayer layer = new RasterLayer(dataSource, id);
layer.setPersistentCaching(true); // optional

If needed, TMSMapLayer class source code can be found in AdvancedLayers project.

PackagedMapLayer can be converted to PackagedRasterDataSource and RasterLayer similarly (setting persistent caching is not needed and should be avoided). There is no built-in version of StoredRasterDataSource though, so if StoredMapLayer functionality is needed, its source can be taken from AdvancedLayers and integrated into the project.

Clone this wiki locally