Skip to main content

All Questions

57 votes
5 answers
59k views

Large dataset of markers or dots in Leaflet [closed]

I want to render about 10.000 markers or dots on a leaflet map. I already did it the regular way and I found it is way slower compared to Google Maps. I'm looking for a way to render multiple elements ...
AFP_555's user avatar
  • 2,518
45 votes
8 answers
87k views

custom marker icon with react-leaflet

I tried everything I found on the web, Stackoverflow and Github, and I still can't make it. I want to make a custom marker with a custom icon, but with my code below I always got an error : '...
arnaudambro's user avatar
  • 2,583
15 votes
1 answer
37k views

leaflet.js - Set marker on click, update position on drag

for a small project I am working on, I need to be able to place a marker on a leaflet.js powered image-map and update the position of this marker, if it gets dragged. I use the following code to try ...
kirijanker's user avatar
7 votes
1 answer
6k views

Leaflet - How to match marker and polyline on drag and drop

I have a project with leafletJS. For example, I have 2 points (A, B) in map. I display it as 2 Markers I must draw a polyline from A to B. I moved marker A and I want to the head of polyline of marker ...
Truong Mai's user avatar
4 votes
3 answers
11k views

How to add text below a marker in leaflet?

I created some markers on leaflet map but the only problem is that i dont know how to add a text below each marker and im not talking about popups. What I mean is that the text below the marker has to ...
Jackson_Stake's user avatar
19 votes
5 answers
38k views

Rotate marker in Leaflet

How can I rotate a marker in leaflet? I will have a lot of markers, all with a rotation angle. I've tried this solution from runanet/coomsie at Leaflet on GitHub, but nothing happens with my marker: ...
sindrejh's user avatar
  • 293
3 votes
2 answers
8k views

Getting the count of markers in a layer in leaflet

I have a Leaflet map with a layer called flickrpics that is loaded dynamically in geojson based on the bbox of the current map view. I would like to get a simple count of the number of markers in that ...
jamesinealing's user avatar
2 votes
1 answer
4k views

Trouble using Leafletjs MarkerClusterGroup and filters with Mapbox

I've tried Mapbox and their API to create an interactive map. The purpose is to fetch points in a geojson file, and display them on the map. They have to be filtered by their marker-icon and grouped ...
Mat_'s user avatar
  • 61
1 vote
1 answer
4k views

Get center of geojson Continent/Country/State with leaflet

Is there a way of finding a center for countries/continents which consist of more than one polygon object(ex. USA, Canada, which have an islands besides main land part)? I was trying to use leaflet's ...
Kamilius's user avatar
  • 588
-1 votes
1 answer
7k views

Leaflet filter markers by name using checkbox

I want to filter my markers by name, using map.addLayer(nameOfTheMarker) and map.remvoeLayer(nameOfTheLayer) with a checkbox like this: $('#markertoggle').change(function () { if (!this.checked) ...
RogerHN's user avatar
  • 594
68 votes
1 answer
53k views

Leaflet.js center the map on a group of markers

I'm using Leaflet.js and would like some way to centre the map on the markers I have so that all are within the user's view when the page launches. If all the markers are clustered in a small area, I ...
lorless's user avatar
  • 4,418
8 votes
2 answers
3k views

Leaflet.label not showing over the markers

I am having a set of geoJSON points and they have corresponding labels attached to them. var points = L.geoJson (null, { onEachFeature: function (feature, layer) { layer.options....
wont_compile's user avatar
8 votes
2 answers
21k views

Leaflet custom marker icon scale to zoom

I use Leaflet to draw an OpenStreetMap and attach it with a custom icon marker var mymap = L.map('mapid').setView([x, y], 13); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?...
necroface's user avatar
  • 3,445
7 votes
1 answer
7k views

Leaflet custom icon resize on zoom. Performance icon vs divicon

I was trying to resize my custom icons when zooming in leaflet. I came up with two solutions for this. One using the L.Icon tag, the other one using L.divIcon. In both examples I only set 1 marker and ...
PSZ_Code's user avatar
  • 1,045
7 votes
1 answer
20k views

How to make markers in Leaflet blinking

Is there a simple way to make a marker in Leaflet map blinking ? I mean animated blinking - something like a loop of transition from opacity 1.0 to opacity 0.5 in 1 second and then reverse, end of ...
user avatar

15 30 50 per page