ʕ ᵔᴥᵔ ʔ
ʕ ᵔᴥᵔ ʔ

Reputation: 792

WMTS layer not showing in ArcGis Android runtime 100.2.0

Using the Android Runtime API 100.2.0, I would like to add a WMTS layer as a basemap. Unfortunately the layer is not showing in the map. The WMTS service url is https://geodata.nationaalgeoregister.nl/tiles/service/wmts?request=getcapabilities. It seems to be available in Key Value Pairs (KVP) encoding only. One of the layers in this WMTS service is the one I would like to use as a basemap: "top100raster". The spatial reference is Amersfoort / RD New: EPSG Projection -- Spatial Reference (http://spatialreference.org/ref/epsg/amersfoort-rd-new/).

Activity code:

private SpatialReference spatialReference = SpatialReference.create(28992);
private double[] bbox = new double[]{646.36, 308975.28, 276050.82, 636456.31};

mapView = (MapView) findViewById(R.id.map);
mapView.setViewpoint(new Viewpoint(new Envelope(bbox[0], bbox[1], bbox[2], bbox[3], spatialReference)));

ArcGISMap map = new ArcGISMap(spatialReference);
mapView.setMap(map);

WmtsLayer wmtsLayer = new WmtsLayer("https://geodata.nationaalgeoregister.nl/tiles/service/wmts?", "top100raster"));
Basemap baseMap = new Basemap(wmtsLayer);
map.setBasemap(baseMap);

There are no errors in the project, also it compiles and runs without errors. The map however is empty :-(

What am I missing here?

Upvotes: 0

Views: 298

Answers (1)

ʕ ᵔᴥᵔ ʔ
ʕ ᵔᴥᵔ ʔ

Reputation: 792

Problem solved... the modified code below works.

private SpatialReference spatialReference = SpatialReference.create(28992);
private double[] bbox = new double[]{646.36, 308975.28, 276050.82, 636456.31};

mapView = (MapView) findViewById(R.id.map);

ArcGISMap map = new ArcGISMap(spatialReference);
map.setInitialViewpoint(new Viewpoint(new Envelope(bbox[0], bbox[1], bbox[2], bbox[3], spatialReference)));

WmtsLayer wmtsLayer = new WmtsLayer("https://geodata.nationaalgeoregister.nl/tiles/service/wmts?request=GetCapabilities&service=WMTS", "top100raster");
Basemap baseMap = new Basemap(wmtsLayer);

map.setBasemap(baseMap);
mapView.setMap(map);

Upvotes: 0

Related Questions