$(function(){
$.getJSON('data.json', function(data){
new jvm.WorldMap({
map: 'world_mill_en',
container: $('#map'),
markers: [
{latLng: [47.5, 19.0833], name: '1'},
{latLng: [51.5170, -0.1050], name: '2'}
],
//markers : data.results,
});
});
});
The code works, but when loading from JSON nothing happens. I assume my JSON format is not right. How to correct my data.json?
{["latLng":[47.5,19.0833], "name": "1"},{latLng: [51.5170, -0.1050], name: "2"}]}
Quotes are missing around your second Array object elements.
It should be