mapbox-gl-js
mapbox-gl-js copied to clipboard
map.addSource() should accept a POJSO
(plain-old JavaScript object)
e.g.:
map.addSource("geojson", {
"type": "geojson",
"data": {
...
}
});
But map is not accepting a variable that contains the json object. In that case it throws the error: "Input data is not a valid GeoJSON object."
@rjairath addSource will accept a variable containing a JSON object, but the variable has to point to valid GeoJSON. You can view the GeoJSON spec at geojson.org and validate and debug your GeoJSON with geojson.io.