Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet]

An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps

1
vote
0answers
52 views

Did leaflet-bing-layer change? (Angular 6)

So for the development of my app I've been using Esri's basemap. I wanted to switch to bing. This is my import as i saw in another question asked here. import 'leaflet-bing-layer'; Then this is in ...
0
votes
0answers
19 views

Angularjs leaflet can't remove layer

I have 2 function, 1 to add markers and 1 to remove markers. What I am doing to add markers $scope.getMapData = function (msg, passedIndex) { msg = L.layerGroup(); for (var i= 0; i < $scope....
0
votes
1answer
50 views

How to highlight marker dynamically with leaflet and leaflet draw

I am trying to make a selection via drawing a rectangle (or any shape) with leaflet draw. The selected features should be highlighted. I saw that there are various functions within the leaflet source ...
1
vote
0answers
29 views

Algorithm to cluster coordinates within a maximum radius [closed]

I am looking for an algorithm that will allow me to find the centers of clusters of an arbitrary radius, such that all coordinates are covered. Currently, I am doing a very basic routine where I ...
0
votes
2answers
58 views

How to fit bounds after adding multiple markers

I am using this piece of code to display map markers pulled from a MySQL database using leaflet js on an open street map, but the map bounds are obviously hard coded at the top (with setView), and I ...
0
votes
1answer
37 views

Change Leaflet Map Layer/Terrain Style

I'm going to show KML file using Leaflet's plugins named Omnivore KML (https://www.mapbox.com/mapbox.js/example/v1.0.0/omnivore-kml/) I've read the tutorial, implement the source code, and it ...
2
votes
0answers
24 views

Revert the resized polygon in L.Draw.Event.EDITED event

I'm trying to stop the user in edit mode to don't overlap on other shape. In CREATED event, I can easily remove the layer. But in EDITED event I want to revert the shape back to original position ...
1
vote
0answers
32 views

Changing Leaflet Projection?

I am new to leaflet. I am trying to change leaflet project to 32624 but it is not working. The map is not showing neither the marker. var crs = new L.Proj.CRS('EPSG:32634', '+proj=utm +zone=34 ...
0
votes
0answers
18 views

Is it possible to use Leaflet.TileLayer.HERE plugin files with @asymmetrik/ngx-leaflet package in Angular 6?

I'm attempting to use the Leaflet.TileLayer.HERE with the Angular package: @asymmetrik/ngx-leaflet without success. It's usually due to a L is not defined. I tried including the javascript file in ...
1
vote
0answers
26 views

Leaflet ImageOverlay Image does not appear

I'm trying to stitch the picture taken from my drone onto the map, and I'm using Django 1.11.14 and latest version leaflet 1.3.4. I tried to use ImageOverlay, there is no error but the image does not ...
0
votes
0answers
46 views

How to update the markers in real-time using ajax

I am facing some problem where the markers is not being updated when the values in the database changes(i am using a stored procedure which get the latest location based on the timestamp). ...
1
vote
1answer
26 views

geodango form with geometry field and leaflet map

i use geodjango and leaflet and i want to create a django form where including geometry field with map widget (the user must to put in leaflet map) like as django admin page . i try to follow this ...
0
votes
1answer
20 views

Different Icon per feature with Leaflet Ajax

How can I have a circle marker or one of a selection of icons depending on a feature's properties using LeafletAjax? https://github.com/calvinmetcalf/leaflet-ajax function pointToLayer(feature, ...
0
votes
0answers
52 views

Extract PostGIS data using shapefile/GeoJSON in OpenLayers/Leaflet

I have a PostGIS database of large shapefiles and would want A Web-App be able to let the user upload the .shp file and extract data based on it's extent. I've used the OpenLayers library to ...
1
vote
0answers
37 views

Is there any way to map match static points to roads using PostGIS

I'm using PostGIS and Leaflet for positioning elements on map. Because of GNSS (GPS) error, points are not always on road. Is there any way to eliminate that error and position element to road? I don'...
0
votes
0answers
20 views

Get lat-lng after popup drag end

How can I get location of popup aftar drag event ends in this code. layer.on("click", function(e) { let popup = L.popup() .setLatLng(e.latlng) .setContent("sample popup") .openOn(map); ...
1
vote
1answer
26 views

GeoJSON data is not displaying, while a sample GeoJSON file displays Point data perfectly fine

I am trying to display some point data on a map but my GeoJSON does not appear to be able to display correctly. I have an example GeoJSON whose formatting looks somewhat different and it displays as ...
0
votes
0answers
45 views

Leaflet Circle Radius - How to transition between meter radius and pixel radius?

When creating circles using leaflet, we have to specify the radius in meters. That is fine, except I need to save the circle radius in pixels, which I can easily do by reading the _radius variable, ...
0
votes
0answers
43 views

Leaflet/CARTO.js: Emulate layer click (=open info window) after search & fitBounds?

I defined info windows with the CARTO.JS event "featureClicked" - unfortunately, this does not work after the user selects a layer in the search bar that is not part of the actual map. Any idea how ...
0
votes
1answer
49 views

Leaflet map with jQuery autocomplete: fitBounds (click input) on selection?

I'm trying to fire a click event on my search button and/or the input field as soon as a user selects something from the jQuery autocomplete <li>: https://jsfiddle.net/grh2dLyw/1/ I'm not sure ...
0
votes
0answers
32 views

Attaching markers to a certain zoom level

Explanation of the title : Let's call "N", the number of markers that will be placed on the map, and "Z" the zoom level. Depending on the zoom level, I need attach N markers to that specific zoom ...
0
votes
0answers
35 views

Dynamic marker selection in Leaflet?

All of these markers can rotate around themselves, resise when a popup is opened. The problem that occurs, is that when this specific popup is closed, a variable called markerNumber counting all ...
0
votes
1answer
30 views

Use QGIS 3.2 for TMS such as leaflet 'TMS:true' tag

Forgive me for using a loose title, I wanted to add a XYZ tile (http://this/is/url/{z}/{x}/{y}.png) with QGIS 3.2 XYZ tiles. Unfortunately, I had some issues showed in the image. The TMS layer works ...
0
votes
0answers
19 views

What should I use as the origin and resolution in the Proj4Leaflet for EPSG:25833

I am new to leaflet and I'd like to have a map based on EPSG:25833. I used the Proj4 like the code below: var crs = new L.Proj.CRS('EPSG:25833', '+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs', ...
1
vote
0answers
45 views

What happened in using L.CRS.EPSG4326 or not in leaflet? [closed]

Not Use L.CRS.EPSG4326:: map = new L.Map('map', { center: [21.43078,51.12748], zoom: 13 }); Use L.CRS.EPSG4326: map = new L.Map('map', { center: [21.43078,51.12748], zoom: 13, ...
3
votes
1answer
76 views

Adjust leaflet routing machine draw (animate) route speed

I use leaflet routing machine and it's working fine with me. Here is my code: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <...
2
votes
1answer
123 views

Server side clustering with geohash

I need help with clustering algorithm. I have a mysql database with lat, lng, geohash(12 chars). I am usign this query to select all records for zoom level 2 (2 chars) SELECT COUNT( id ) , LEFT( `...
0
votes
1answer
44 views

Can't display vector layer using L.vectorGrid.protobuf

I use mapbox/tippecanoe to create .pbf tiles. But when I try to display them using L.vectorGrid.protobuf nothing is rendered, although I see that proper .pbf files are requested and downloaded by ...
0
votes
0answers
34 views

Legend not shown in r-leaflet.minicharts and zoom buttons not working anymore

This script used to display a legend for the pie charts on the map. I cannot find the reason why the legend is not shown anymore. I suppose it is related to some problem with the leaflet plugin ...
0
votes
0answers
41 views

Leaflet, Are Draw Rectangle Coordinates WGS84?

I am using leaflet to develop an web interface for accessing NASA's Climate Hazards Research Group CHIRPS dataset via API (http://chg.geog.ucsb.edu/data/chirps/). In the CHIRPS documentation it ...
1
vote
1answer
60 views

Conversion to Leaflet from Google Maps Throws Image Overlay Out of Alignment?

I'm in the middle of transitioning away from Google Maps and to Leaflet due to the recent change in Google Maps usage policy. I've converted all but one of my map pages, but unfortunately, that one ...
0
votes
1answer
38 views

Leaflet - Hide marker before zoom shows marker?

I have a few thousand markers which are grouped in feature groups which i show depending on the zoom level. At the moment i run the the show/hide function for each feature group after the event zoom ...
2
votes
1answer
108 views

Query layer with leaflet-geopackage

I'm trying to find any documentation to help me understand and use the leaflet-geopackage plugin. what I want to do is use the full potential of the .gpkg file as a database and query only part of the ...
0
votes
1answer
166 views

Saving leaflet map as image?

My map is in a HTML page Lots of markers will be placed on the map I need to save this map with all the marker in a img (.png or .jpg/.jpeg preferably) format, not the entire HTML page Is there a ...
1
vote
0answers
55 views

Drawing graph elements (nodes and edges) in Leaflet?

I need to build a simple online map editor and I'm intended to use leaflet (but can eventually use openlayers). How can I draw graph elements (nodes and edges) in leaflet (on top of a map). ...
0
votes
0answers
25 views

Edit GeoJSON file: adding countries

I'm using leaflet in R to create an interactive map. I have this map although it has only the United Kingdom, I would like to have the UK: Nothern Ireland and the UK: Great Britain. I would like to ...
2
votes
0answers
91 views

GeoJSON to Leaflet map using Django template

I have a view that returns this GeoJSON data {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-74.6739518440393, 40.7747050657312], [-...
3
votes
1answer
258 views

How to display pie charts in a web map created using QGIS?

I have created a web map to show some sales information using QGIS with Leaflet library. I wonder if there is a way to show pie charts in the same web map as a separate layer? Although pie charts ...
0
votes
1answer
26 views

Leaflet Custom Control - changing background colour of existing control

I have a Leaflet map with two custom controls on it (coverage1000Control and coverage2500Control). coverage1000Control is defined thus: coverage1000Control = L.Control.extend({ options: { ...
0
votes
1answer
33 views

cartojs 4 and print button [closed]

Is it possible to use the print function of leaflet with cartojs v.4? i'm not able to use all this plugins https://leafletjs.com/plugins.html#printexport The print button works but can i use also ...
0
votes
2answers
26 views

Updating popup of a Leaflet Polygon

I am trying to update a popup for a polygon that I have drawn with Leaflet.Draw. Now I understand that to set a popup to a layer I just created, it's all fine. I can also get the id of that layer I ...
0
votes
0answers
33 views

Spiderfy all Leaflet markerClusters with fewer than 5 markers

I am making a Leaflet map using markerCluster.js. I would like to make all clusters with fewer than 5 markers automatically "spider", regardless of the zoom level. For example in the image below, I'd ...
0
votes
1answer
59 views

Leaflet on mouse wheel event change zoom by delta

I am trying to find a way to change zoom by delta when using mouse wheel event (scroll) in Leaflet. E.g. current map zoom is on 0 and if "scrolled" into map, zoom should be 5. Also, zoom change ...
1
vote
1answer
81 views

Showing all features by real-time API with Leaflet Map

I want to show all URL parameters or features onto a map. I have made the variable with ajax query as well as inside the loop data is printing with variable but I want to show this data with map into ...
0
votes
0answers
18 views

Searching methods Leaflet Markers (0.7.7 WindyAPI Map)

I've built a custom search function, mainly because its much less work than re-engineering a plugin to cooperate with the WindyAPI. This search function just searches for an ID I've assigned and uses ...
1
vote
0answers
32 views

Dropping images coming from a certain file inside our map [closed]

I've been charged of this yesterday : Finding a way for the user to drag a picture that he took before and dropping inside the map element this picture is coming from an outside file like D:\images\...
1
vote
0answers
45 views

QGIS 3D and QGIS Webmap, Javascript; Search Bar

I exported my webmap, using QGIS2web. The QGIS2web already has a search bar, but the placement icon when I search, as it applies to my project, always shows below my uploaded raster images. When I ...
0
votes
0answers
29 views

Markers popups only work once spiderfied

I am seeing what looks like this problem - leaflet popups only work if spiderfied. This is a bug report (closed) from 2012, if this had never been fixed I would have expected more commentary. Is ...
0
votes
0answers
37 views

How to make a basemap appear in a Leaflet map?

I've created a Leaflet map with an ESRI Gray basemap and polygons of European countries taht is dispayed on button click. The basemap is not visible when I open the map, but if I drag on the map it ...
0
votes
0answers
21 views

Extract geometry from TileJSON map

I would like to get to know where the pipeline data of http://mapa.cartocritica.mx/ is hidden. The map is using Leaflet and json tiles from GIS Cloud like http://tiles.giscloud.com/t/1524762449/...