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
46 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
32 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
39 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/...
1
vote
1answer
45 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
14 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
2answers
173 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
49 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
73 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
158 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
1answer
79 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
45 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
21 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
64 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
159 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
35 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
23 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
99 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
101 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
38 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
19 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
64 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
156 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 ...
-1
votes
1answer
83 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
131 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
110 views

Pass GeoJSON properties to on click event in Leaflet?

I need to create a map with GeoJSON 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
111 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
53 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
177 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 ...
1
vote
1answer
89 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
130 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 ...
1
vote
0answers
56 views

Converting latitude/longitude to full range referential

I have a list of latitudes and longitudes expressed as follow: -1 <= latitude <= 0 0 <= longitude <= 1 Those coordinates represent POIs on a fantasy map displayed using the Leaflet ...
3
votes
0answers
278 views

Make a grid map in Leaflet

I want to draw a grid map based on the temperature values in Leaflet. Similar to the illustration below. Input data: lat, lon, temperature values, cities' names Parameters: the dimensions of the ...
1
vote
1answer
128 views

leaflet icon size based on lat/lon degree?

I want to plot multi markers on Leaflet like a grid map. We often seen icons based on pixel size, but I couldn't find case that used lat/lon-sized(e.g. 0.5 degree) icons. What should I do? ↓In the ...
0
votes
1answer
59 views

Where can I find correct shapefile for Montenegro municipalities?

I downloaded a shapefile for Montenegro from https://gadm.org/download_country_v3.html and created a table in PostGIS using shp2pgsql. The table has column geom of type geometry which is a ...
0
votes
1answer
152 views

Leaflet: added GeoJSON Feature to FeatureGroup doesn't show up

I have a geojsonLayer and a selectionLayer. I want to add specific features to the selectionLayer after a click event. I create the selectionLayer at startup: selectionLayer = new .FeatureGroup()....
0
votes
1answer
56 views

Show/hide layers (not sublayers) via selector in legend - carto.js v4

I am trying to build a layer selector using carts.js.v4, similar to the one provided in Carto Builder. Examples of layer selectors that I have found utilize sublayers and my maps are using separate ...
2
votes
2answers
100 views

How to add a dynamic number of pictures into a Leaflet popup?

I have a huge dataset of playgrounds I want to represent in a Leaflet map. Every playground has a different number of photos (between 1 and 13) connected as an attribute value. The value contains ...
1
vote
1answer
72 views

Counting number of visible entries using jsTree

I'm displaying a tree via jsTree within a jQuery dialog box and that is running fine. Now I want to resize the dialog box depending on the number of visible entries of the tree. Resizing is not the ...
0
votes
1answer
59 views

Display markers and autohide them after few seconds using data of nested JSON object from an API in Leaflet Map

I'm trying to load 4 markers at a time and timeout should be 5 secs for them and then new markers should come up and old one's should be hidden automatically. I have written this code and unable to ...
2
votes
0answers
229 views

Listen to a click event inside bindpopup with Leaflet

I'm using Leaflet, I have bound popups to layers, and created a popupopen event listener on the map as follow: map.on('popupopen', this._managePopUp.bind(this)); _managePopUp(layer) { ...
0
votes
0answers
74 views

Leaflet.js - Add a filter on a specific Key with pre-existing markers

Going back to my previous question : https://stackoverflow.com/questions/51786003/leaflet-js-create-layers-and-add-markers-depending-on-geojson-category-data (I didn't have a clear answer to resolve ...
1
vote
0answers
124 views

Leaflet Draw: edit/delete features of different layers

I use Leaflet Draw and Leaflet WFST plugins to create/edit features and save my edits to PostGIS Database (hosted by GeoServer). I have three layers: points, lines, and polygons. I manage to make new ...
0
votes
1answer
62 views

Mousemove on Geoserver Tile with Leaflet

Coming from intensive usage of Leaflet with open source tiles and remote data layers (multipolygons, markers, etc...) retrieved from a PostgreSql database, I wanted to try Geoserver capabilities to ...
2
votes
0answers
130 views

Basic Authentication in Leaflet

I'm using Leaflet to display map tiles. The map tiles are loaded from a different site using basic authentication. So the url template looks like this: L.tileLayer('https://username:password@example....
0
votes
1answer
104 views

How to change the border of CircleMarker in Leaflet?

I'm using Leaflet 1.3.4 and I want to change the border of CircleMarker (make it bigger). I created it in this way: var geojsonMarkerOptions = { radius: 25, fillColor: "#24D238"...
3
votes
1answer
198 views

Avoid OpenStreetMap loading shops, monuments, restaurants and any other POIs?

I am loading OpenStreetMap using Leaflet. More or less I'm doing this: var objmap = new L.Map(p_objCapaMapa, mapOptions); var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; ...
2
votes
1answer
59 views

Turning sublayers on/off in QGIS2Web Leaflet export

For some simple maps, I need to turn sublayer on and off. Like in the example (a) and (b) with Leaflet/Qgis2Web.
1
vote
2answers
73 views

Filtering out irrelevant point features in QGIS2Web Leaflet export

I'll make some simple maps with data-points with Leaflet or QGIS2web but it seems like it is big drawing blue transparent dots at the points I have no data. I just want to see my data-points (like the ...
1
vote
0answers
57 views

Leaflet sidebar-v2 not floating display on mobile

I don't want the sidebar to always fill the entire vertical side, solved that by adjusting the height of the .sidebar.collapsed However, when on a mobile device it still fills the entire side ...