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

0
votes
0answers
21 views

Leaflet invalidateSize not working

I have a Leaflet map div inside another div. The map does not appear correctly (It appears correctly if Map div is not nested). I have tried several CSS options (i.e visible, display ..) to no avail. ...
-2
votes
0answers
13 views

LOADING PART OF MY GEOJSON FILE ON LEAFLET [on hold]

am a newbie to JavaScript and leaflet,i have geojson file that consist of about 3000 markers. though i can load my all the markers using L.geojson function, my issue is trying to load few of my ...
0
votes
0answers
11 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 ...
1
vote
0answers
10 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 ...
1
vote
1answer
24 views

Saving a leaflet map as an image

So, to clear things up: 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 ...
1
vote
0answers
27 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
18 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
44 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], [-...
0
votes
0answers
19 views

Populate selected polygons on LeafLet [on hold]

I have good reason to prefer LeafLet over Google Maps. I have 12 selectable features (polygons) on my map. It works fine, but I am wondering how to populate these features on initialize. For example I ...
3
votes
1answer
160 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
9 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
28 views

cartojs 4 and print button [on hold]

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
16 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
12 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
18 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 ...
0
votes
0answers
27 views

Showing all features by real-time API with Leaflet Map

I want to show all URL parameters or features onto a map. It is coming by console but with the map. It is giving error properties not defined. How can I write a function to show secure API data onto ...
0
votes
0answers
6 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
20 views

Dropping images coming from a certain file inside our map

I've been chraged 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
24 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
13 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
22 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
15 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/...
1
vote
1answer
18 views

Dynamically set mapview based on the overlay feature of L.geoJson coordinates in Leaflet

I want to dynamically setView of the map based on the overlay feature which I extract from L.geoJson in Leaflet. I tried using fitBounds, which doesn't seem to work. Here is the code snippet: var ...
0
votes
0answers
8 views

TileLayer.WMS and Map Panes

When I am using TileLayer.WMS and Map Panes. I am trying to put a WMS loaded through TileLayer.WMS into a map pane. Whenever I do that, the WMS is not displayed. Looking at the DOM, the WMS Layer is ...
0
votes
1answer
39 views

Leaflet - map.fitBounds() / map.getBoundsZoom() BROKEN after resizing map?

https://jsfiddle.net/MaxHeadroom/s6h40xrn/ If you resize the map size, the zoom level should be adapted to always show the orange rectangle at maximum possible size. But fitBounds seems to be broken ...
0
votes
0answers
24 views

Drawing extra markers on a leaflet map with addDrawToolbar in R

I have added a Toolbar on a leaflet map to make it easy for non-coders to draw markers. For this purpose I make use of the following R packages: leaflet, leaflet.extras, and shiny. I have a couple ...
1
vote
1answer
56 views

Making one marker adjustable at a time

This screenshot is an example of what I have to do : This picture was taken on a different and older version of what I have now, since all of the present images were NOT markers bound to the map ...
1
vote
0answers
48 views

How to add a text on a Leaflet map

Each day I need to draw a path on a map and add a text (like 4, 5 or 8 min) indicating how long it takes by car from the starting point to the destination (see the figure below). I thought it would ...
0
votes
0answers
9 views

How to get FeatureCollection by loading KML in Leaflet.FileLayer

I am loading a kml file into my map and after presenting this polygon using Leaflet.FileLayer plugin. I want to get all convert kml data into geojson formate. Here is my code: var layer = L.Control....
0
votes
1answer
58 views

qgis2web Leaflet - How to add the +/- symbol to reduce the layers in legend and how to add a logo in the webmap?

I'm newbie to edit HTML of Leaflet of qgis2web. I have some questions for you: How can I put for each layer the sign "+" and "-" to reduce the legend of each layer. How can I add a logo in the webmap?...
2
votes
1answer
36 views

Error on showing .js as spatial object with JSON.parse()

I have a Leaflet map exported by qgis2web plugin. The geodata is stored as (Geo-)JSON-objects inside a variable saved as .js-file. I have an attribute field ("bildpfad") with comma-separated pathes to ...
0
votes
0answers
14 views

Consuming Amazon S3 hosted PNGs with quadkey format as tile

I have PNG tiles hosted in an Amazon S3 Bucket. I would like to consume these as a layer into a leaflet map. I have taken this example for reference which converts the quad key to tiles. How would ...
0
votes
1answer
25 views

Leaflet : Auto-creations of markers on Polyline

I am new to to Leaflet. I am drawing polylines on map but markers are pinned automatically (unwanted). Please suggest me that how can avoid auto-creation of marker (<img ...>) I was using ...
0
votes
2answers
50 views

Leaflet L.geoJSON.getLatLng() is not a function

I am trying to get latlang of a marker so I can use it and fly to later. map.flyTo(myLayer.getLatLng() ,16); But why do I get getLatLng() not a function? codepen example
0
votes
1answer
20 views

Adding and removing WFS layer using Leaflet control?

I need add and quit a layer WFS vía Leaflet Control, So far I can add the WFS layer to the map, but how do I add it and remove it using the leaflet control? This is my code. var owsrootUrl ='http://...
2
votes
0answers
15 views

Caching tiles Leaflet 0.7.7

I've searched here as best as I could, and can't find a direct answer on how I could go about caching the map to speed up loading on zoom. It seems most caching options were introduced in 1.0.0 which ...
3
votes
0answers
67 views

Markers with customs angle values

I'm trying to make some markers spinnable using this : target = document.getElementById("mapid"); target.ondragover = function(e){ e.preventDefault(); e.dataTransfer.dropEffect = "move"; }; ...
1
vote
1answer
46 views

Using Planet Labs API tile service with leaflet map

I'm using Planet Labs API tile service with leaflet map. Need to add it as a tile layer/WMS layer. But the map stays the same when zoomed in or out. My Map: https://drive.google.com/open?id=...
2
votes
1answer
26 views

Leaflet GeoJSON Map Buffering

I am using Leaflet with Custom GeoJSON Layers to display my map. I noticed that the map off-screen is only loaded after releasing the mouse button during a drag. Hopefully, this demo makes it more ...
0
votes
0answers
16 views

Leaflet attribute features update from online database

What are some options to show updated attribute data in a Leaflet map? For example, I have a Leaflet map that shows polygons for the different parks in a region and when a user clicks on a map, a ...
0
votes
0answers
46 views

Creating basic authorized service with AJAX and adding with Leaflet map

//Here I want map this url data for which how to write a function into ajax call please suggest me as soon as possible. after running this code it is giving data as array on consol. how to display ...
2
votes
1answer
55 views

Leaflet OSM Cross origin issue when zoom level > 19

I am playing around a bit with Leaflet and run into an issue. I am using the OSM tile service https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png. But I get CORS problem when I zoom in closer than ...
0
votes
1answer
34 views

Leaflet map with toggleable overlays - reading in data from a PostgreSQL database

I have a Leaflet map with several sets of points read in from a PostgreSQL database. I would like to make each of these collections an overlay that I can toggle on and off. Without having overlays I ...
1
vote
2answers
63 views

Leaflet popup disappear or moved over drawn polygon

If I would like to popup something over an actually drawn polygon, then it sometimes disappear or moved to the first point of the polygon. https://jsfiddle.net/o149mgwj/19/ var drawnItems = new L....
0
votes
0answers
62 views

How to pass Geo-json properties to on click event in leaflet?

I need to create a map with geo-json file which content feature properties. I want to show feature properties with click on map here is the code which i am using please let me know if i am wrong ...
1
vote
0answers
86 views

Making custom markers resizable in Leaflet?

This fiddle (from Stefan_Fairphone) is a quick example of what I need to do for a project. But i need to add two features for these custom markers: make them scalable and spinnable. I'm trying to ...
0
votes
0answers
26 views

How to show on Leaflet: WMS on top of OpenMapTiles (vector PBF)?

I made a simple Leaflet page with the following content: Overlays: a geojson polygon file WMS polygon layer from Geoserver of my own (tiled=true) Baselayers: All 4 Google Maps: road, terrain, ...
2
votes
1answer
84 views

Dragging and dropping images into Leaflet map to create image markers?

I am using Leaflet. I need to make custom, draggable, resizable icons for the map, using custom images that are set inside a sidebar as such: <div id="mySidebar" class="sidebar"> <a ...
0
votes
1answer
56 views

How can I show a popup in a map, using Leaflet?

How can I show a popup in a map, using Leaflet, loading the markers from an GeoJSON external file? function onEachFeature(feature, layer) { if (feature.properties && feature.properties....
1
vote
1answer
61 views

Leaflet.locate: permission error on different browsers

I inserted a simple button for geolocation into a Leaflet-generated map by adding L.control.locate().addTo(map); into my HTML file. In Chrome and Firefox it works great, Safari and Internet ...