Select to view content in your preferred language

WmsLayer reloads all tiles when panned

3241
6
03-28-2013 04:48 AM
Labels (1)
ae
by
Frequent Contributor
Hi,

I'm using a WmsLayer as the basemap in my application. When I pan the map slightly to one side, the WmsLayer will reload all visible tiles, even though the large portion of the tiles have already been loaded. In other words: when I pan the map just slightly, all visible map tiles disappear and load over again. This differs from the behavior of and ArcGISTiledMapLayer, which will only load the tiles that have not already been loaded. Is there some way to get a similar behaviour in a WmsLayer?

btw. I'm using ArcGIS API for WPF version 2.4.

Cheers
0 Kudos
6 Replies
DominiqueBroux
Esri Frequent Contributor
A WMS layer is not a tiled layer but a dynamic layer.
It means that each time the map extent changes a request is done to the WMS server in order to get a new image covering the map extent.
That's the normal behavior and we can't change it.

The OGC tiled layer is called WMTS (Web Map Tiling Service). It's also supported by the ArcGIS API by using a WMTS layer.
0 Kudos
ae
by
Frequent Contributor
Thanks for your reply dbroux! Luckily for me the map that I want to use in my application is also available as a WMTS. Unfortunately though, nothing happens when I try to load the map (i.e. no tiles are loaded). My code for adding the map is the following:

<Esri:WmtsLayer Visible="True" 
Version="1.0.0" 
Layer="matrikkel_bakgrunn" 
Url="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?" />


Information about the service (i.e. available layers and such) can be found here:

http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?Version=1.0.0&service=wmts&request=getcapabi...

Does anyone know what I'm doing wrong here?

Cheers
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I don't run into any issue by using your code as the only layer of a map:
<esri:Map Name="MyMap" WrapAround="True">
    <esri:WmtsLayer Layer="matrikkel_bakgrunn"
           Url="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?"
         Version="1.0.0" Visible="True" />
</esri:Map>

In this case, the WMTS gets correctly displayed.

You may run into issue if your map contains others tiled layers using others spatial references.

In this case, you have to force the SR of your WMTS layer by setting the TileMatrixSet property to a supported matrix set having the same SR as others layers.For example:
<esri:Map Name="MyMap" WrapAround="True">
    <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
    <esri:WmtsLayer Layer="matrikkel_bakgrunn"    TileMatrixSet="EPSG:3857"   
                    Url="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?"
                    Version="1.0.0" Visible="True" />
</esri:Map>
0 Kudos
ae
by
Frequent Contributor
That's very strange indeed. When you got it to work, did you use Runtime 1.0?

I'm using version 2.4, and I cannot get it to work, even if I create a completely new project and copy/paste your code above into it.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I just tested with WPF 2.4 and that seems working as well (see screenshot).
[ATTACH=CONFIG]23319[/ATTACH]
What is your issue exactly?

Try to use fiddler to look at requests sent to the server, that might give a clue about your issue.
0 Kudos
ae
by
Frequent Contributor
*Yay* it's working now. Thanks dbroux!

To be specific, the following did not work (i.e. no tiles are loaded):

<esri:Map Name="MyMap" WrapAround="True">
    <esri:WmtsLayer Layer="matrikkel_bakgrunn"
           Url="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?"
         Version="1.0.0" Visible="True" />
</esri:Map>


As soon as I added a ArcGISTiledMapServiceLayer, and then set the TileMatrixSet as below, it worked as a charm: 

<esri:Map Name="MyMap" WrapAround="True">
    <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" /><esri:WmtsLayer Layer="matrikkel_bakgrunn"    TileMatrixSet="EPSG:3857"   
                    Url="http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?"
                    Version="1.0.0" Visible="True" />
</esri:Map>


My only issue now is that the loading time of the tiles seems to slow down at times (i.e. suddenly it takes up to 30 seconds to load a new set of tiles). This is a different issue however and I will try to debug it with Fiddler.

Again thanks for your help dbroux!
0 Kudos