For that you will need to turn on "developer mode" to find out zoom parameters.
To do so add the following code:
map.developerMode = true; map.addListener("writeDevInfo", function (event) { alert('zoomLevel:'+event.zoomLevel+'\nzoomLatitude:'+event.zoomLatitude+'\nzoomLongitude:'+event.zoomLongitude); });
Reload the map. Zoom and position the way you want it to appear.
Click left mouse button anywhere on the map while holding the SHIFT key.
An alert box will appear with the zoom information.
Use that information to populate your map data:
var dataProvider = { mapVar: AmCharts.maps.worldLow, getAreasFromMap: true, zoomLevel: 2.74, // insert the values... zoomLongitude: -20.1341, // from the alert box... zoomLatitude: 49.1712 // here };
Can you show an example in JSFiddle? I added your code to the Interactive Flight Map and didn't get it to work.
I just modified the dataprovider like this (i want to make a zoom out transition from detail Map (eg : franceLow) to worldMap)
{code}
map.addListener("homeButtonClicked", function (event) {
if(map.zoomLevel() == 1){
dataProvider.zoomLevel= map.getDevInfo().zoomLevel*5; // insert the values...
dataProvider.zoomLongitude= map.getDevInfo().zoomLongitude; // from the alert box...
dataProvider.zoomLatitude= map.getDevInfo().zoomLatitude; // here
map.dataProvider = dataProvider;
map.write("mapdiv");
}
});
{code}
I fixed the zoomLevel to 5, but i want to make a transition between full zoom to zoomLevel = 5.
Do you have any tips to do this ?