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

170
Vistas
How to display user location on leaflet map

I'm trying to display user location on a leaflet map.

I've searched and researched and still could not implement the code properly I've tried using:

    navigator.geolocation.getCurrentPosition(getPosition)

but I must not be implementing code correctly. here is my code for the leaflet map. please show how I can make it show user location instead of fixed coordinate

         <div class="text-block">
            <h5 class="mb-4">Listing location</h5>
            <div class="map-wrapper-300 mb-3">
          <div class="h-100" id="detailMap"></div>
       </div>
    </div>

     <script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js" integrity="sha512- 
     GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" 
     crossorigin=""></script>
     <!-- Available tile layers-->
     <script src="/js/map-layers.js"></script>
     <script src="/js/map-detail.js"></script>
     <script>


    createDetailMap({

        mapId: 'detailMap',
        mapZoom: 14,
        mapCenter: [26.3750, -80.1011],
        circleShow: true,
        circlePosition: [26.3750, -80.1011]

        })


     </script>

please help and provide code if possible! thank you

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