Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!