Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Trying to Bind Tooltip to Result of Turf Distance Method

I'm trying to simply put the results of the distance variable in the tooltip but keep getting undefined. I don't understand what's happening. I know it's something simple. Thanks!

                
                // convert Leaflet layer to geojson with Leaflet toGeoJSON() method
                var centCounty = countyPolygon.toGeoJSON();

                // get centroid of county polygon
                var centroid = turf.centerOfMass(centCounty);

                // create marker from centroid
                var lon = centroid.geometry.coordinates[0];
                var lat = centroid.geometry.coordinates[1];
                
                var marker = L.marker([lat, lon]).addTo(map).bindTooltip(`${distance} Miles`).openTooltip();

                var distanceGeoJSON = marker.toGeoJSON();

                var from = searchedFeature
                var to = distanceGeoJSON
                var options = {units: 'miles'};

                var distance = turf.distance(from, to, options);
                console.log(distance)
  
            }
        }```
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda