I'm trying to display small circles (or markers) on a map with leaflet from a geojson file. It works with "MultiPolygon" geometry type but not with "Point" geometry type. I don't understand why ?
// My GeoJson points
let Points = {"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","properties":{"id":"25","name":"Essai Point","activity":"WC","image":"image4.jpg"},"geometry":{"type":"Point","coordinates":[[-0.3783868407297,43.304121626953]]}},{"type":"Feature","properties":{"id":"27","name":"Essai Point2","activity":"WC","image":"image5.jpg"},"geometry":{"type":"Point","coordinates":[[-0.378387,43.30413]]}}]}
// My JavaScript code
let style = { radius: 8,
fillColor: "#ff7800",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
};
let circles = L.geoJson(Points, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, style);
}
}).addTo(mymap);
</script>```
// Console error
LatLng.js:32
Uncaught Error: Invalid LatLng object: (undefined, -0.3783868407297,43.304121626953)
at new D (LatLng.js:32)
at We (GeoJSON.js:235)
at De (GeoJSON.js:186)
at i.addData (GeoJSON.js:117)
at i.addData (GeoJSON.js:107)
at initialize (GeoJSON.js:92)
at new i (Class.js:22)
at Object.Ke (GeoJSON.js:439)
at noelburos.php:116