gis - geojson to maps using Google Maps API -
I am trying to project my geographic data on the map. This is when I came to this doctor from Google.
https://developers.google.com/maps/documentation/javascript/datalayer Does anyone working with Google Maps API Meaning of this code segment:
// Load a geoogen from the server similar to our demo, map.data.loadGeoJson ('https://storage.googleapis.com/maps- devrel / google.json '); What does it mean to load a GeoJSON from the same server as our demo? My geographical file is in my local drive (C :). How can I modify the code so that my JSN file is full?
Thank you.
If you assign your HTML file to a file: // -URL, Are loaded with examples. file: ///.c: /myfile.html , you should be able to use map.data.loadGeoJson ('file: /// C: /mydata.json') . However, keep in mind that this works only when you are loading your HTML / Javascript and data of that same origin.
ToS does not allow you to host API scripts, you may have to setup a local webserver for testing. You can control cross-all access by setting HTTP headers.
Comments
Post a Comment