简体   繁体   中英

Can't get jvectormap's setFocus method to work with region name

I am trying to focus on a specific region on the map using region name instead of latitudes and longitudes.

for example, this doesn't work for me:

map.setFocus({region: 'IN'})

After a lot of researching, I got this to work by doing this:

    var mapObj = $('#world-map').vectorMap('get', 'mapObject');

    mapObj.setFocus({region: 'IN'})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM