Skip to Content

Zooming Analytical Map

Hello All,

I am trying to zoom to a particular location in an analytical map.

I am using this code to display my map ques1.png

The map looks fine, but now on selection of a particular parameter I want to zoom into the map.

I am using zoomToRegions(aCodes,oCorr) method to zoom into the map, but am unable to understand what aCodes should be.

Please guide.

Thanks,

Aakanksha

ques1.png (10.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 13 at 05:14 PM

    Hi,

    The aCodes is an array of the region codes you want to zoom into, each code is the same as the one you defined in the JSON of the map.

    If you download this example and insert the following code instead of onRegionClick function, you'll get what codes are and how to zoom (once you'll click a region you'll get 150% zoom into it)

    onRegionClick: function(e) {
     var aCodes = [];
     aCodes.push(e.getParameter("code"));
     var oCorr = 1.5; //A factor
     this.byId("vbi").zoomToRegions(aCodes, oCorr);
    },
    
    Add comment
    10|10000 characters needed characters exceeded