Estoy luchando para que mis puntos GeoJSON aparezcan en el mapa del folleto.
Los códigos para el javascript donde traté de agregar GeoJSON:
var coniferous = L.layerGroup(); var geojsondata = new L.GeoJSON.AJAX("treedata2.geojson", { pointToLayer: function(geoJsonPoint, latlng) {return L.marker(latlng);}}).addTo(coniferous);Ya hice referencia al complemento ajax en la sección principal del archivo html
<script src="leaflet.ajax.js"></script>El código del archivo GeoJSON es el siguiente
{ "type": "FeatureCollection", "name": "Significant Trees", "features": [ {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-79.484593, 43.696533, 0.0]}, "properties": {"What_is_the_species_name": "Maple"}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-79.433099, 43.846487, 0.0]}, "properties": {"What_is_the_species_name": "Pine"}} ] }También intenté usar coordsToLatLng, pero no parece ser el problema, ya que los marcadores aún no aparecen, ni siquiera en las ubicaciones incorrectas.
Debe agregar LayerGroup al mapa: var coniferous = L.layerGroup().addTo(map);