springmeyer / arc.js

great circle routes in javascript
http://springmeyer.github.io/arc.js/
BSD 2-Clause "Simplified" License
369 stars 70 forks source link

update leaflet to 1.8.0 to fix demo in Safari #47

Closed jgravois closed 2 years ago

jgravois commented 2 years ago

resolves #46

ref: https://github.com/Leaflet/Leaflet/issues/7255

springmeyer commented 2 years ago

Thanks!

jgravois commented 2 years ago

no worries at all. your issue reminded me i had a few TODO:s of my own. 🙏

Nicocaputocai commented 1 year ago

Hi! i update to leaflet 1.9 and i cant see my layers. Any solution?

jgravois commented 1 year ago

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.

Nicocaputocai commented 1 year ago

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

jgravois commented 1 year ago

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.

Nicocaputocai commented 1 year ago

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;
jgravois commented 1 year ago

none of the code you shared comes from arc.js so there's not much we can do about your problem here.

https://github.com/springmeyer/arc.js#api