Select to view content in your preferred language

Changing SpatialReference does not allow display of basemap

2684
9
Jump to solution
01-23-2019 12:17 PM
DavidMillican
Emerging Contributor

I start my map in WebMercator and set the basemap using Basemap.CreateTopographicVector(). All displays as expected. I allow my user to select a different spatial reference where I create a new map passing the selected SpatialReference and then add the basemap in the same way as before and the basemap does not display. Is there something else I should be doing to allow for this or are vector basemaps not allowed to reproject? I did this in 10.2.7 fairly easily.  Just trying to figure out how to accomplish this in 100.x now. 

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

> It impossible to reproject a basemap in 100.x runtime for .NET? 

This is more about whether a layer supports reprojection or not - it has nothing to do with the basemap itself, but only the layers that are present in the basemap (or in the operational layers for that matter). If all the layers in your basemap support reprojection, they will all display - otherwise only the ones that do. As mentioned earlier, tiled layers (image and vector) does not, so you'd need to use the ArcGISMapImageLayer instead of ArcGISTiledLayer.

View solution in original post

0 Kudos
9 Replies
dotMorten_esri
Esri Notable Contributor

The spatial reference of tiled layers (vector or raster) must match the spatial reference of your map, as these layer types does not support projection on the fly.

Either don't set the SR on the Map and let the basemap layers drive the SR when it loads, or set the "correct" SR on the map.

10.2.7 had the same limitation.

0 Kudos
DavidMillican
Emerging Contributor

But in 10.2.7 I could set the SpatialReference for the map and then when it requested the tiled layer from the ArcGIS online rest service, the layer would be returned in the specified SpatialReference(if I understand it correctly). Is that still possible in 100.x?

0 Kudos
dotMorten_esri
Esri Notable Contributor

10.2.7 couldn't reproject tiled layers either. Are you sure you didn't declare a dynamic layer instead?

Also 10.x didn't have vector tile layer support either.

0 Kudos
DavidMillican
Emerging Contributor

I am using ArcGISTiledMapServiceLayer in 10.2.7. If I set the SpatialReference for the map to something other than WebMercator then I see the layer reprojected to that SpatialReference. Yeah if 10.2.7 had support for vector tiles then we would have used them(if they supported reprojection of course). 

So is there no way that you know of to reproject a basemap in 100.x? 

0 Kudos
DavidMillican
Emerging Contributor

Using Fiddler to capture the network traffic as I change the map's SpatialReference I see something like this...

http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export?bbox=-126.110427699194%2C15.1598412754068%2C-57.3560880326194%2C61.7189024596362&bboxSR=4269&imageSR=4269&size=1078%2C730&dpi=96&transparent=true&f=image

You can see the SR specified in the web request and the image return reflects the reprojection. I can clearly see very different reprojected images returned even looking at the image returned in Fiddler outside of the map view.

0 Kudos
dotMorten_esri
Esri Notable Contributor

That request is indicating that you are not using a tiled layer, but a dynamic layer. You can also do this with the 100.x releases. Just beware that you are bypassing all the significant performance improvements a tile cache otherwise give you.

Note that a vector tiled layer doesn't have the export/dynamic mapserver capability that most image tiled layer services does, so you still won't be able to reproject with vector tiles.

0 Kudos
DavidMillican
Emerging Contributor

Hey Morten. In your estimation, is it impossible to reproject a basemap in 100.x runtime for .NET? If so I need to abandon my upgrade immediately as I've sunk quite a bit of time into it already and am still missing quite a few features that I had in 10.2.7. 

0 Kudos
dotMorten_esri
Esri Notable Contributor

> It impossible to reproject a basemap in 100.x runtime for .NET? 

This is more about whether a layer supports reprojection or not - it has nothing to do with the basemap itself, but only the layers that are present in the basemap (or in the operational layers for that matter). If all the layers in your basemap support reprojection, they will all display - otherwise only the ones that do. As mentioned earlier, tiled layers (image and vector) does not, so you'd need to use the ArcGISMapImageLayer instead of ArcGISTiledLayer.

0 Kudos
DavidMillican
Emerging Contributor

Thanks for getting back to me on this Morten. Using ArcGISMapImageLayer in 100.x did allow me to reproject so that gets me passed a potentially big hurdle in my upgrade. However, it did seem to be significantly slower to update the image compared to 10.2.7 for this layer. 

0 Kudos