Let's say I have a geoJSON data stored in a variable or parsed as an object:
// GeoJSON stored as an object
var segment = segment;
// GeoJSON saved as a JSON string
var json = JSON.stringify(segment);
Now, the challenge is to display this geoJSON on a Google map. The good news is that it's valid and the JSON string in json
can be seen when pasted into a validator like .
Unfortunately, simply using myMap.data.loadGeoJson(json);
doesn't do the trick. It seems like there isn't much documentation out there about importing geoJSON data directly without using a file.