xamarin forms add wmts no errors nothing is changed on the map

1130
6
09-30-2021 08:46 AM
batkaj
by
New Contributor II

Screen Shot 2021-09-30 at 11.45.16 PM.png

 here is my code. but it's displaying just basemap

Screen Shot 2021-09-30 at 11.38.47 PM.png

0 Kudos
6 Replies
dotMorten_esri
Esri Notable Contributor

First check the load status of your layer (or just call `await layer.LoadAsync()` ) and inspect the error (if there is one). If it loads fine, check the LayerViewState for the layer on the MapView instance.

0 Kudos
batkaj
by
New Contributor II

well the LoadAsync is returning loaded . LayerViewState event is giving null.

0 Kudos
dotMorten_esri
Esri Notable Contributor

When you say the layer view state even is giving 'null' what do you mean? You should be getting events for each layer, and there is a status as well as potentially an error object. The status is the most interesting thing.

My guess is the spatial reference of your WMTS service doesn't match that of your basemap, and tiles services doesn't support reprojection. The view state should tell you if that is happening.

You can also try to remove the basemap and only have your WMTS layer, so that the map would assume the spatial reference of your WMTS layer instead.

https://developers.arcgis.com/net/api-reference/api/netwin/wpf/Esri.ArcGISRuntime.UI.Controls.GeoVie...

https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Map...

0 Kudos
MatveiStefarov
Esri Contributor

One common problem for WMTS layers not displaying is: incompatible spatial references between the Map and the layer.

Check the TileMatrixSets property of your WmtsLayerInfo -- each tile matrix set has a SpatialReference.  You want to use a tile matrix set with the same spatial reference as your Map.  Normally WmtsLayer will automatically choose the first compatible set (if the server has any) but you can also use the WmtsLayer constructor that takes a WmtsTileMatrixSet.

If the service does not have any WmtsTileMatrixSet compatible with the Map, you may have to use a different SpatialReference for your Map, re-publish the WMTS service with a different tile set, or use a different service type that supports reprojection (e.g. WMS or ArcGIS MapService).

0 Kudos
batkaj
by
New Contributor II

May be this is the case. Because the map tiles is created by Map Tiler opensource program. Ok i'll check this up.

 

0 Kudos
batkaj
by
New Contributor II

Screen Shot 2021-10-04 at 5.15.45 PM.png

 

also layerstatusModels

Screen Shot 2021-10-04 at 5.18.33 PM.png

0 Kudos