javascript - Google Maps display geoJSON from variable instead of file -


so have geojson saved in variable or parsed object:

// geojson object var segment = segment;  // geojson json string var json = json.stringify(segment); 

how able display on google map? it's valid , json string stored in json visible when paste validator http://geojsonlint.com/ .

sadly, doesn't work:

mymap.data.loadgeojson(json);

and can't find other documentation google maps tells me how import geojson data directly without file.

the method load data directly geojson-object called addgeojson

you'll find description in methods-section of google.maps.data


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -