Select to view content in your preferred language

where to add minZoom and maxZoom options in TAB Theme?

3006
8
03-17-2016 03:13 PM
WilsonLee
Regular Contributor

Hi All,

I've downloaded the codes for the TAB THEME map and I would like to update the mapOption with setting minZoom and maxZoom properties. But i couldn't find the core.js or main.js in the folder (see attached screenshot), where do I add the min/maxZoom options to?

Please help.

thanks,

Wilson

(i'm looking for this piece of script and try to insert min/maxzoom options)

var mapDeferred = esri.arcgis.utils.createMap(WEBMAP_ID, "map", {

mapOptions: {

slider: false,

wrapAround180:false

minZoom: 10,

maxZoom: 12

Tags (1)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Wilson,

  You add those to the mapOtpions object in the main config.json (line 23 below):

"map": {
    "3D": false,
    "2D": true,
    "position": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 0
    },
    "itemId": "your item id",
    "mapOptions": {
      "extent": {
        "xmin": -9588945.63048467,
        "ymin": 3961163.9078186783,
        "xmax": -9521681.045593806,
        "ymax": 4027893.4335115473,
        "spatialReference": {
          "wkid": 102100
        }
      },
      "showAttribution": false,
      "logo": false,
      "maxZoom": xxxx,
0 Kudos
WilsonLee
Regular Contributor

Hi Robert,

Thanks, I found the the config.json and add the min/max options. But it didnt work. My map can stil zoom in and out to all levels.

do you have any ideas what's going on?

      "mapOptions":{

         "extent":{

            "xmin":6070767.733441663,

            "ymin":1977523.8093268164,

            "xmax":6083470.535432744,

            "ymax":1986454.2640599394,

            "spatialReference":{

               "wkid":102643,

               "latestWkid":2227

            }

         }

      },

   "minZoom": 13,

   "maxZoom": 19,

      "id":"map",

thanks again : )

Wilson

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Wilson,

  You have those properties outside the MapOptions object.

This should be correct:

    "mapOptions":{
         "extent":{
            "xmin":6070767.733441663,
            "ymin":1977523.8093268164,
            "xmax":6083470.535432744,
            "ymax":1986454.2640599394,
            "spatialReference":{
               "wkid":102643,
               "latestWkid":2227
            }
         },
         "minZoom": 13,
         "maxZoom": 19
      },
0 Kudos
WilsonLee
Regular Contributor

Hi Robert,

I placed the min/maxzoom within the MAPSOPTIONS now and it's still not working:

"mapOptions":{

         "extent":{

            "xmin":6070767.733441663,

            "ymin":1977523.8093268164,

            "xmax":6083470.535432744,

            "ymax":1986454.2640599394,

            "spatialReference":{

               "wkid":102643,

               "latestWkid":2227

            }

         },

  "minZoom": 15,

  "maxZoom": 18

      },

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Wilson,

  It works perfectly for me maybe you are still not putting it in the right place. If you are working on adding this to a spcific app you have already created the add the code to [install dir]\server\apps\[app #]\config.json.

Here is the whole map object this time:

"map": {
    "3D": false,
    "2D": true,
    "position": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 0
    },
    "itemId": "xxxxxxxxxxxxxxxxxxxxxxxxx",
    "mapOptions": {
      "extent": {
        "type": "extent",
        "xmin": -9612248.7868645,
        "ymin": 3963609.132773641,
        "xmax": -9499359.691251043,
        "ymax": 4030413.4467841494,
        "spatialReference": {
          "wkid": 102100
        }
      },
      "minZoom": 15,
      "maxZoom": 18
    },
    "id": "map",
    "portalUrl": "http://xxxxxx.maps.arcgis.com/"
  },
0 Kudos
WilsonLee
Regular Contributor

my codes are same as yours. I check all the config.json files and only the one at top level (index.html level)  has the "mapoptions".

   "map":{

      "3D":false,

      "2D":true,

      "position":{

         "top":44,

         "right":0,

         "bottom":24,

         "left":55

      },

      "itemId":"???????",

      "mapOptions":{

         "extent":{

            "xmin":6070767.733441663,

            "ymin":1977523.8093268164,

            "xmax":6083470.535432744,

            "ymax":1986454.2640599394,

            "spatialReference":{

               "wkid":102643,

               "latestWkid":2227

            }

         },

  "minZoom": 17,

  "maxZoom": 20

      },

  

      "id":"map",

      "portalUrl":"https://????.maps.arcgis.com"

   },

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Wilson,

  As I mentioned it worked fine for me. Are you restarting your wab app and clearing your browser cache?

WilsonLee
Regular Contributor

yes, i did

anyway, thank you for your help. I really appreciate it

0 Kudos