我对Jvectormap的另一个令人沮丧的问题,我希望通过lngLat专注于页面/地图上的标记加载,我该怎么做?理想情况下,最好关注这个标记或专注于latlng.我只会在每张地图上显示1个标记,但我不会知道x/y只是lngLat或可能是国家代码.可能有一种更简单的方法来做到这一点,所以欢迎提出建议.感谢您的高级帮助
var markers = [ {latLng: [47.774099, -52.793427], name: "loc 1", label: "This blahblah"}]
$(function(){
$('#map1').vectorMap({
map: 'world_mill_en',
scale: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.7,
hoverColor: false,
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
backgroundColor: '#383f47',
markers: markers,
focusOn:{
latLng: [47.774099, -52.793427],
scale: 5
},
onMarkerLabelShow: function(event, label, index) {
label.html( ''+markers[index].label+'');
}
});
});
Run Code Online (Sandbox Code Playgroud)