Skip to main content

All Questions

0 votes
0 answers
25 views

Leaflet : how to force using a specific tile server when zooming on known locations?

I'm using leaflet for displaying some maps. I know that my users will zoom in for some location. As you know, tiles are realtime calculated if zoom is high. I want to store pre calculated zoomed tiles ...
1 vote
1 answer
88 views

How to set active region correctly in this Leaflet map?

I want to hightlight active region with nid=105. I did it in "color: feature.nid == 105 ? '#fa9f1a' : 'white'". But I have a problem, when I clicked to another region, region with nid=105 ...
0 votes
0 answers
23 views

How to properly zoom and update OpenStreetMap tiles on my JS Maps

When I launch the file everything works fine and the mouse movements are correct however the zoom is catastrophic and it does not zoom/refresh the next tiles of OpenStreetMap class CustomMap { ...
0 votes
0 answers
22 views

setZoom not working in Chrome but is working in other browsers

I am unable to get setZoom or any of the zoom features to work on my leaflet map in Chrome. It works fine in Firefox and Edge but I need it to work in Chrome also and cannot find anything on this. Any ...
0 votes
0 answers
24 views

Polyline starts from main world map instead of nearest point [duplicate]

I am using Leaflet map to draw polylines and connect waypoints by clicking on the map. I also cloned the route and waypoints to the left and right world map. Sometimes, the route is drawn incorrectly. ...
45 votes
9 answers
50k views

leaflet map shows up grey

I'm starting leaflet.js with the quickstart but my map shows as grey... is there something I'm missing? script.js: var leafletMap = L.map('leafletMap').setView([51.505, -0.09], 13); L.tileLayer('...
0 votes
1 answer
3k views

Find user's current location with Leaflet

In my project I am using leaflet to display points. I want to get the current lat and long after clicked on button Show Your Location, I tried the below code: https://jsfiddle.net/a1p26e7v/ What do i ...
0 votes
1 answer
381 views

Handling Average of a lot of Values

I'm inserting Markers with a specific Value onto an Openstreetmap via leaflet. Futhermore I want those Markers to get Clusterd while zooming out of the map. The Clustericon should show the average ...
0 votes
0 answers
24 views

Can I load basemap without center or set view in map initialization

I have the center coming from a different layer, however, that layer is loading slowly so initially you see a blank map container.so, I want the basemap to be visible. view.map = L.map('map_' + mapId, ...
1 vote
1 answer
98 views

custom zoom-in zoom-out buttons in leaflet using pico.css

Coming from this answer to customization of marker in leafleat: remove blue background from markers, now i have the following problem: .html file: <!DOCTYPE html> <html lang="it">...
3 votes
1 answer
108 views

remove blue background from markers

how to remove the blue background from the markers? this happen using default icon and a custom one (png with transparent background) am I doing something wrong? <!DOCTYPE html> <html lang=&...
0 votes
0 answers
31 views

Cannot achieve live navigation using js,openstreetmap and leaflet

I'm currently working on implementing live navigation functionality in a web application using JavaScript. The goal is to update a tracker marker on a map according to the user's position on a ...
1 vote
0 answers
35 views

Leaflet OpenStreetMap Changes View based on window size

I am using Leaflet and OpenStreetMap to generate an interactive map. The map generates fine and you are able to interact with the map. The issue I am encountering is if the user has a large screen ...
0 votes
1 answer
84 views

How can I get geoJSON file read correctly in JavaScript?

I am using Leaflet and OpenStreetMap's to display a map on my page. I followed the steps to create a simple map on the page. Once I was able to generate a map, I follow the steps on creating a geojson ...
0 votes
1 answer
81 views

How to add arrow-marked lines in Leaflet map to indicate direction from one location to another?

I'm working on a project involving Leaflet maps, and I'm trying to find a way to add arrow-marked lines to indicate direction from one location to another. Can someone please provide guidance or code ...

15 30 50 per page
1
2 3 4 5
19