Add Multiple layers as basemap

409
2
11-18-2011 02:36 AM
NianweiLiu
Occasional Contributor II
Hi,
Does anybody knows how to author a web map with multiple layers as basemap, like the esri's "XX with Labels". Basically those maps have a base tile layer, and another reference layer. However, in the arcgis.com viewer, you can only add one tile layer as basemap.
Also, those layers carries information like "isReference", but there is no way in the online viewer to set them.
Is there an API or some sort to post a JSON config for the web map, so we can manually setup a webmap according to its JSON specs?

"baseMap": {
    "baseMapLayers": [
      {
        "opacity": 1,
        "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",
        "visibility": true
      },
      {
        "isReference": true,
        "opacity": 1,
        "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",
        "visibility": true
      }
    ],
    "title": "Terrain with Labels"
  },



Finally, what about the "tasks"? It's showing up in json response, but it seems to no way to define them in viewer yet.

Thanks,

Nianwei
Tags (2)
0 Kudos
2 Replies
MikeMinami
Esri Notable Contributor
Basically, the basemap is actually composed of two services, the data is in one service and the labels are in another. We explicitly hide the labels layer although it is really there in the map. You can achieve the same result in your map, you'll just see the labels layer in the Contents panel of the map. There is no public API for arcgis.com. ArcGIS.com, however, is built on the JavaScript API. You can build your own app that does exactly what you want.

http://help.arcgis.com/en/webapi/javascript/arcgis/

Thanks,

Mike
0 Kudos
NianweiLiu
Occasional Contributor II
True, but the user get a slightly different user experience, and it's not subject to the basemapGallery add/remove behavior.

For now, I'll use Fiddle to get the same result until the API is available.