कैसे जोड़ें मैं वेबसाइट पर एक नक्शा जोड़ने के लिए jVectorMap प्लगइन का उपयोग कर रहा हूं। यहां एक नक्शा है जहां मैंने पेज लोड पर मार्कर जोड़े। क्या गतिशील रूप से ऐसा करने का कोई तरीका है? मुझे उन्हें माउस क्लिक पर जोड़ने की ज़रूरत है। मैं jVectorMap प्लग इन का उपयोगjVectorMap - मार्कर गतिशील रूप से
var plants = [
{name: 'VAK', coords: [-25.274398, 133.775136], status: 'mrk'},
{name: 'MZFR', coords: [37.090240, -95.712891], status: 'mrk'},
{name: 'AVR', coords: [50.9030599, 6.4213693], status: 'mrk'}
];
$('#world-map-markers').vectorMap({
map: 'world_mill_en',
normalizeFunction: 'polynomial',
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
backgroundColor: '#383f47',
markers: plants.map(function(h) {
return {
name: h.name,
latLng: h.coords
}
}),
series: {
markers: [{
attribute: 'image',
scale: {
'mrk': 'marker.png'
},
values: plants.reduce(function(p, c, i) {
p[i] = c.status;
return p
}, {}),
}]
}
});
});
वर्क्स एक आकर्षण की तरह !! – Jude