How: Change the target Web Map in the JSON of a Web App?

71
2
Jump to solution
Thursday
Labels (1)
Highlighted
New Contributor III

I needed to make changes to the JSON of an existing web map that is part of a web app. Before replacing it, I want to test the JSON changes on a new web map.

 

The new web map is a near duplicate the replacement--including its data sources, published services, and the layer ID. The main difference is in the itemIDs it uses to reference several feature layers.

The Web App uses a lot of configured widgets including different Searches, Group Layers, and the eSearch widget. I don't want to have to re-do any of those. Is there an easy location within the Web App's JSON I can change to point to the new web map instead?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

You can define the new web map id by changing it in the app config.json file. Look for the  itemId value found under the map object.

 "map": {
    "3D"false,
    "2D"true,
    "position": {
      "left"0,
      "top"40,
      "right"0,
      "bottom"0
    },
    "itemId""<your map id>",
    "mapOptions": {
      "extent": {
        "xmin"-14304987.782245828,
        "ymin"3965994.21067048,
        "xmax"-12185541.861955022,
        "ymax"5115607.116079226,
        "spatialReference": {
          "wkid"102100
        }

View solution in original post

2 Replies
Highlighted
Regular Contributor

You can define the new web map id by changing it in the app config.json file. Look for the  itemId value found under the map object.

 "map": {
    "3D"false,
    "2D"true,
    "position": {
      "left"0,
      "top"40,
      "right"0,
      "bottom"0
    },
    "itemId""<your map id>",
    "mapOptions": {
      "extent": {
        "xmin"-14304987.782245828,
        "ymin"3965994.21067048,
        "xmax"-12185541.861955022,
        "ymax"5115607.116079226,
        "spatialReference": {
          "wkid"102100
        }

View solution in original post

Highlighted
New Contributor III

Thank you! I had been searching for where the map's itemID was but just couldn't locate it.

In retrospect, I suppose I could have used ctrl+f to and searched for the map's item id...

Reply
0 Kudos