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
Leaflet Geocoder use a default address

I'm trying to create a website for a fast food company with more than 50 branches. I want to use Leaflet.js as map and geocoder for getting location from address. On every branch page, I need to find the location from address and mark it on the map.

I've checked leaflet and geocoder but could not find how to pass a default address value to map instead of using search function. All examples show search and get the location but I want to find location from address(text) and pass this location to setView. Is there a function to use it for this purpose? (Note: I don't use any Js framework)

<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css" />
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>

   var map = L.map('map').setView([0, 0], 5);
var geocoder = L.Control.Geocoder.nominatim();

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    maxZoom: 8,
    attribution: '© OpenStreetMap'
}).addTo(map);

var address = 'ASD AASD ASD' // I don't know where to use address
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