Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda