Skip to main content

All Questions

Tagged with
45 votes
9 answers
49k 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('...
Connor Leech's user avatar
  • 18.6k
3 votes
2 answers
2k views

Unable to display only the points within a specific range (circle) using the .getBounds() function (Leaflet)

I am trying to display a certain amount of points within a specific range, that is within a circle. But when using the .getBounds() function for comparison to see whether the point is within the bound,...
Jonathan Lam's user avatar
  • 1,310
29 votes
6 answers
27k views

How to identify Leaflet's Marker during a `popupopen` event?

when a marker is clicked, I need to execute some code that finds the id corresponding to the marker being clicked , retrieves data from backend API, then adds the newly retrieved data to the content ...
Nyxynyx's user avatar
  • 62.8k
24 votes
2 answers
22k views

How to add markers bulk in leaflet?

I have an array with ~30k elements and I need to create map with markers for each of them. I use markerclusters and trying to optimize adding moment. for (var i = 0; i < myItems.length; i++) { ...
Egor Sazanovich's user avatar
4 votes
1 answer
2k views

Why isn't my map completely showing?

I am using Leaflet to display a map. I just changed my HTML to use jQuery Mobile and Leaflet. I read the documentation for jQuery Mobile, which says I have to add jQuery 1.11. <script src="http://...
martin10's user avatar
  • 199
4 votes
1 answer
5k views

Global map tiles disappear past zoom level 19

I use OpenStreetMap with Leaflet.js. I have a map with an indoor picture on it. The problem is when I zoom in, streets disapears. Do you know anything that can solve this plz? Tricks or tips! EDIT: ...
Orelsanpls's user avatar
  • 23.3k
55 votes
1 answer
48k views

Get address from co-ordinates using OpenStreetMap [closed]

I'm looking for a solution which gives an address based on co-ordinates (Latitude & Longitude) which I got from html5 geolocation api. I'm using OpenStreetMap.
vishal's user avatar
  • 695
14 votes
2 answers
38k views

How to add only one marker in leaflet map

I am adding marker on map on user click. Problem is that I want only one marker but now whenever I click on map new marker is added. I am trying to remove it but nothing happens: var marker; map....
1110's user avatar
  • 7,197
11 votes
1 answer
11k views

Show only United States when using Leaflet.js and OSM

I'm using leaflet.js and OSM tiles to create a map, but I'd only like the continental United States to be viewable, not the entire world. Is that possible? I'm loading the map like this: var map = L....
frajk's user avatar
  • 863
5 votes
1 answer
4k views

R Leaflet Legend: specify order instead of alphabetical

I added legend to r leaflet code and output is this I would like the order to be GREEN "More than 66%" ORANGE "Between 33% and 66%" RED "Less than 33%" Code sep <- read.csv("31R_SEP_assets_csv -...
Rhonda's user avatar
  • 1,691
5 votes
1 answer
2k views

How to use leaflet slider along with markercluster in Javascript?

i am making a map that uses a slider to show or hide markers, and i want to add clustering functionality, each one alone works perfectly, but i want the slider to show the markers, and in case of ...
jaafar Nasrallah's user avatar
5 votes
3 answers
624 views

Plotting OpenStreetMap relations does not generate continous lines

All, I have been working on an index of all MTB trails worldwide. I'm a Python person so for all steps involved I try to use Python modules. I was able to grab relations from the OSM overpass API like ...
Freek's user avatar
  • 1,187
5 votes
1 answer
4k views

OpenStreetMap often sends Gateway Timeout error

I am using a leaflet map in program with the following code: <style> <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-...
LBes's user avatar
  • 3,416
5 votes
2 answers
9k views

How to add two geoJSON feature collections in to two layer groups

I have two geoJSON feature collections that I need to add to the map, and I also want them to be toggled on and off via the layer visibility controllers as shown in http://leafletjs.com/examples/...
thusithak's user avatar
  • 129
3 votes
1 answer
3k views

Integrating OpenStreetMaps with Cordova

I was wondering if any of you might have any idea how i can use Open Street Maps(OSM) with cordova? Searching for days now.. All i can conclude is that i am not supposed to directly use OSM's API's ...
Uraforclain's user avatar

15 30 50 per page