I'm using the following code to set the initial zoom level for my jvectormap:
$('#world-map').vectorMap('get', 'mapObject').setFocus({
scale: 3
});
After I initialise this scale property, the zoom level is set, but the zoom in/out buttons are now blocked. Also in the console I get the following error:
Unexpected value scale(2.4000000000000004) translate(undefined, undefined) parsing transform attribute.
How can I correctly set the zoom level, and leave the zoom in/out on?
Just googled a bit and i found an object to be attached in the vectorMap instance:
$("#world-map").vectorMap({
focusOn: {
x: 2,
y: 2,
scale: 3
},
// ...
});
Here the x and y properties are needed to set the position while scale is the scale factor.. very intuitive at all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With