Closed jgravois closed 2 years ago
Thanks!
no worries at all. your issue reminded me i had a few TODO:
s of my own. 🙏
Hi! i update to leaflet 1.9 and i cant see my layers. Any solution?
i know 1.9 included some breaking changes. if you can share a simplified repro case that shows exactly what the issue is that'd make it more convenient to track down the problem.
This is my app. Works ok on all devices except ios
mapa.desarrolloi.org/
My repo
https://github.com/Nicocaputocai/LanusInteligenteMapa
I worked with GeoJSON files
by 'repro case', i mean sharing the bare minimum of code necessary to display the problem you're seeing.
this library doesn't do anything in the way of 'drawing', so if you aren't seeing GeoJSON files in iOS only. it'd be worth whittling things down to confirm that its not a problem with Leaflet itself.
Oh, sorry. I speak English a little.
Here i create the popups
function onEachFeature(feature, layer) {
// does this feature have a property named popupContent?
if (feature.properties && feature.geometry.type != "Polygon") {
return layer.bindPopup(
`<h3>${feature.properties.name}</h3><span>Dirección: ${feature.properties.address} ${feature.properties.height}</span>`
);
}else if (feature.properties && feature.geometry.type == "Polygon"){
return layer.bindPopup(
`<h3>${feature.properties.name}</h3><span>Dirección: ${feature.properties.address}</span>`
)
}
}
async function setMap(arr) {
var map = L.map("map", {
center: [-34.7033363, -58.3953235],
zoom: 13,
"tap": false
});
One example
var health = L.geoJSON(healthData, {
onEachFeature: onEachFeature,
pointToLayer: function (feature, latlng) {
if (feature.properties.dependence == "Municipal") {
return L.marker(latlng, { icon: healthIconMunicipal });
} else if (feature.properties.dependence == "Provincial") {
return L.marker(latlng, { icon: healthIconProvincial });
} else {
return L.marker(latlng, { icon: healthIconPrivate });
}
},
var overLayers = {
Clubes: club,
"Dependencias Municipales": MunicipalDependence,
"Educación Inicial": initialEducation,
"Escuelas Primarias": primaryEducation,
"Escuelas Secundarias": hightSchollEducation,
"Escuelas Técnicas": tecnicalHightSchollEducation,
Universidades: universityEducation,
"Otros establecimientos educativos": otherEducation,
"Parques y plazas": squareAndPark,
Salud: health,
"Seguridad y Justicia": security,
Transporte: transport,
};
L.control.layers(overLayers, baseMap).addTo(map);
})
return arr;
none of the code you shared comes from arc.js so there's not much we can do about your problem here.
resolves #46
ref: https://github.com/Leaflet/Leaflet/issues/7255