Google Map Javascript Load Data from Json File

Hi,
Anyone know how to load json data into google map? i found this code to draw a circle in google map (https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/javascript/examples/circle-simple), I would like to store all geolocation (lat/long) in an external json file, i have no idea where to start can anyone enlighten me, thanks for your help.

//I want to put below lat/long in json file
// First, create an object containing LatLng and population for each city.
var citymap = {
chicago: {
center: {lat: 41.878, lng: -87.629},
population: 2714856
},
newyork: {
center: {lat: 40.714, lng: -74.005},
population: 8405837
},
losangeles: {
center: {lat: 34.052, lng: -118.243},
population: 3857799
},
vancouver: {
center: {lat: 49.25, lng: -123.1},
population: 603502
}
};

Well, as far as i can see you have not to load data directly into google map, you can simply load your json into your script and then the same code applies^^

Here’s few examples on how to load your json:

Layer, thank you so much for your info and sharing, will try to check the link and find futher info.

Thank you.

1 Like