Switch basemap with different wkid in basemap gallery

1824
4
12-02-2013 09:48 AM
tonylife
New Contributor III
Our customer wants to use their own basemap, which has different wkid with esri's default wkid.

To createmap, API allows to pass following valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "oceans", "national-geographic", "osm" to the parameter "basemap", according to API reference.

What I am doing is, temperately use "topo" as basemap when creating map, then use BasemapGallery.select(id) to switch to customer's basemap. However, since customer's basemap and esri's topo basemap wkid are different, I am hitting error Map: Geometry (wkid: 102100) cannot be converted to spatial reference of the map (wkid: 3417) .

Is there a anyway to workaround?

Thanks for your help!
Tony
0 Kudos
4 Replies
JeffPace
MVP Alum
you can't.

Once you set the wkid of a map you cant switch to another unless you render dynamically.  Basemaps are tiled, so you have to stay in the same spatial reference.

If you want to use a custom basemap you have to either stick with it, or tiled it in ESRI's scheme
0 Kudos
ManishkumarPatel
Occasional Contributor II
Hi Tony,

I have a similar requirement and I have been playing around for quite some time. I was disappointed to find that once you add some basemap then you cannot change the basemap unless of same projection.

As of now what I am doing is trying to recreate the map using the below code:

  if (map) {
        map.removeAllLayers();
        map.spatialReference = null;
        map.destroy();
    }

   map = new esri.Map("map", {
            nav: true,
            isPan: false,
            isZoomSlider: false,
            slider: false
        });

But this is not acceptable as it will not retain any changes or layers because it destroys and recreate the map element all over again.

Hope this helps.

Also if you find any work around please do share.

Best Regards,
Manish
0 Kudos
JeffPace
MVP Alum
The reason you cant use the different basemaps is you cannot reproject tiles once they are created.  You could render the basemap dynamically, or (in theory if the api allow project it on the fly) but this would defeat the entire purpose of tiling the service, i.e. speed.

Remember you don't need to reproject your data.  Just set up a new mxd with the data frame projected to web merc aux sphere, and create a new cache.  You will take a performance hit on creating the tiles, but once they are created it will be back to optimal speed.

Google, Bing, and ESRI have all agreed on the same tiling system.  Its rare that happpens (sign from above) so I say go with it.
0 Kudos
by Anonymous User
Not applicable
I want to  use  own basemap, which has different wkid with esri's default wkid.

To createmap, API allows to pass following valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "oceans", "national-geographic", "osm" to the parameter "basemap", according to API reference.

What I am doing is, temperately use "topo" as basemap when creating map, then use BasemapGallery.select(id) to switch to customer's basemap. However, since customer's basemap and esri's topo basemap wkid are different, I am hitting error Map: Geometry (wkid: 102100) cannot be converted to spatial reference of the map (wkid: 32643) .

What is the region in it it will be possible with when i am viewing my map in ArcGIS.com Map

please give me  solution
0 Kudos