I am attempting to showcase a GeoJSON MultiPolygon object on a Leaflet map. I retrieve it from a PostgreSQL database as JSON and transform it into GeoJSON.
I have validated the MultiPolygon object on GeoJSONLint and it checks out:
However, I am facing difficulties in implementing this feature in my application =(
Here is the code snippet:
$http.get(URI_SERVICE+"buscar-clase/"+JSON.stringify(params))
.success(function (data) {
console.log(L.multiPolygon(data.coordinates).toGeoJSON());
adaLayer.clearLayers();
adaLayer = L.geoJson(L.multiPolygon(data.coordinates).toGeoJSON(), {
style: function () {
return {weight: 1, color: "#000000"}
}
});
adaLayer.addTo(map);
}).error(function (err) {
console.log(err);
});
Just a heads up, the map variable is functioning properly, as I have successfully displayed other GeoJSON layers before.