Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
277 views

Leaflet search and popup at other position

In leaflet I want the popup on another position then the standard. So I created a div in which the popup-information is opens. countryLayer = L.geoJson(countryLayer, { onEachFeature: ...
-1
votes
1answer
203 views

Optimum set up for large data sets such as mobile service coverage maps [closed]

When serving up large data sets such as mobile coverage maps (custom tile) mashed up with MapQuest maps and MapQuest POIs, is there any performance benefit to using shapefile vs WMS image PNGs?
1
vote
0answers
22 views

Labeling when using qgis2web

I'm having trouble getting labels to appear in a web map, both Leaflet and OpenLayers, using qgis2web. I can't get either label buffers or backgrounds to show up and even a Bold style only works in ...
0
votes
3answers
6k views

Adding Multiple JSON Layers to Leaflet Map

I'm trying to put two different json files over a single map. One is drawn by zip code boundaries, the other is county. For some reason, I can't get my leaflet to work. IF someone can help point me to ...
1
vote
0answers
29 views

Download data on click via Leaflet webmap [on hold]

I am working on a webmap which will allow users to click on a portion of the globe and download associated river data. Here is my code so far. <!DOCTYPE html> <html> <head> <...
0
votes
1answer
26 views

Open the popups of all markers that are visible on the map with a zoom > 10

I need to open all the markers that are visible on the map at Zoom > 10. I am using leaflet.markercluster plugin. Init map: initMap() { this.map = L.map('map', { center: [55.55, 37.61], ...
0
votes
0answers
10 views

Trigger click on geoJSON layer on dragend

I have a map where users can click on municipality polygones and the lat/lon values of the clicked position as well as the respective municipality name are saved in form fields for later use. I want ...
0
votes
1answer
271 views

Display animated GEOJSON path in Leaflet

I want to do something similar to this example : http://jsfiddle.net/3v7hd2vx/36/ But instead of creating a polyline between the two points, I want to display already digitalised routes all stored in ...
0
votes
0answers
24 views

Leaflet markers at same geo location (ClusterGroup)

I have a map created with leaflet with different markers. Sometimes the markers have the same (1:1) geo position. I have already tested the great addon clustergroup, but I need the function to be ...
1
vote
1answer
397 views

L.control.layers: Uncaught TypeError: Cannot read property 'minZoom' of undefined

I am trying to add my geojson urls which I loaded from my gist as L.LayerGroup for L.control.layers but I have encountered error "Uncaught TypeError: Cannot read property 'minZoom' of undefined" on L....
0
votes
1answer
360 views

How can I create layers depending on a property?

I have a .js file with coordinates for internships: var internships = [{ "features": [ {"type":"Feature","properties":{"category":"entretient","Name":"green"},"geometry":{"type":"Point","...
1
vote
2answers
171 views

Leaflet: Change displayed column on click

I have a GeoJSON layer in a Leaflet map showing buildings. The columns of the buildings layer contain electricity usage info by date (eg., the column 12052015 contains electricity usage on Dec 5, 2015)...
0
votes
0answers
22 views

Mapbox/Leaflet - how to generate evenly spaced coordinates inside a polygon

I'm trying to generate an evenly spaced grid of coordinates inside a polygon. I know that I can generate random points like follows: const polygon = L.polygon([somePoints]).addTo(map); const bounds = ...
0
votes
1answer
284 views

Icon inside Leaflet control layer does not display?

I created a leaflet control layer to switch between two base maps (Bing and OpenCycleMap), Yet I don't see the icon inside the layer control: var baseMaps = { "Bing": bingLayer, ...
1
vote
1answer
96 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
votes
0answers
18 views

Leaflet Draw - Saving vertices latitude / longitudes of user-drawn polygon

How would I go about saving the latitude and longitudes of a user-drawn polygon in Leaflet Draw? I assume this could either be done as the polygon is being drawn, saving on each new vertices, or by ...
0
votes
1answer
18 views

WMTS in Leaflet - Can't make this code work?

I know this have been touched upon before, but the other posts did not entirely do it for me. I'm trying to make a minimal Leaflet .html page with a map, containing a WMTS map. The code looks like ...
1
vote
1answer
42 views

adding dialog plugin qgis2web

I have exported my webmap using qgis2web and while playing with it, I was able to change the settings of the items already present on the map (for example position, language, zoom levels, etc.) ...
1
vote
2answers
577 views

In Leaflet, how to color circleMarkers based on category?

My question is, how can I get Leaflet to color each of circleMarkers I am generating/points with a different color, based off the type property of the point? I've done a bit of research, but all I've ...
0
votes
1answer
27 views

Using JavaScript created select options as Leaflet map setContent

Working on a creating a custom CRS Leaflet map. On map rightclick, show a popup with select boxes for users interaction. var submit_Loc_popup = L.popup(); map.on('contextmenu', onPopupBoxSubmit); ...
0
votes
1answer
478 views

Trying to get WMTS layer in Leaflet, but get error 400 (out of range)

I'm trying to use https://github.com/mylen/leaflet.TileLayer.WMTS to get a wmts layer into my leaflet map, but the error 400 is generated and when I look at the tile it says out of range. While ...
0
votes
1answer
33 views

Update info on a div when map on touchend

I want to update a div with information when I touchend the map on my iPad or iPhone. The information div run correctly with a click version but for a touchend I had to use map.on map.on('touchend', ...
1
vote
1answer
175 views

Showing popup image on hover and click

I want to to show an image when the mouse hovers on a marker or polygon, and on click show a popup with property attributes information from GeoJSON. I can manage to show attributes on click but I am ...
0
votes
0answers
18 views

Make background image visible at all scales in webmap QGIS2web

I'm trying to produce a web map using the QGIS2web plug in and leaflet output, but the background image is not visible when I zoom in beyond some scale. Is there a way to control the scales a ...
2
votes
0answers
18 views

Plotting KML data on Leaflet map

I have 5 different KML files for each subzone of Singapore map. I want to plot the KML data by subzone on a Leaflet map. library(leaflet) library(raster) library(readxl) library(rgdal) setwd("F:\\...
0
votes
2answers
128 views

Converge origins on destination leaflet geodesic

I am using Tabletop.js to map locations on a leaflet map. With each row I add the lat lng to a feature group and then to the map. What I would also like to do is use leaflet geodesic to draw a line ...
0
votes
1answer
90 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
1answer
41 views

Leaflet info box only showing properties from selected layer

I would like to use the info box as shown in the tutorial interactive choropleth map with multiple layers and properties from different layers. The idea is to only show the properties from the ...
0
votes
1answer
302 views

input data coordinates to database from input data inside leaflet js

i have a problem with my update data coordinates form leaflet popup. i just want to make edit form inside leaflet popup. if i click marker in a map it shown coordinate with input form, if the building ...
0
votes
1answer
479 views

“L.Proj is undefined” error when using Proj4Leaflet in Angular 5

I am facing the error "ERROR TypeError: Cannot read property 'CRS' of undefined" caused by L.Proj being undefined. Here what I did : I added Leaflet, Proj4 and Proj4leaflet packages using npm ...
3
votes
1answer
251 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....
1
vote
0answers
33 views

Leaflet dialog box that contains info on 1 to n layers that were clicked on

I have a Leaflet application where the user can click on a feature and the info for that feature will be updated in dialog box. var info = L.control(); info.onAdd = function (map) { this._div = ...
0
votes
1answer
22 views

Show time series data with non-contiguous times using Leaflet TimeDimension plugin

My data is made up of squares forming a grid where the value of each square changes with time. The times are equally spaced with 1 hour intervals, however, the data is only available for a certain ...
0
votes
1answer
48 views

Load GeoJSON polygon time series with Leaflet Time Dimension plug-in?

I have a GeoJSON file with time series data, representing repeating polygons with varying data. I have managed to display the data for one time interval (a subset of the data representing one interval)...
0
votes
1answer
20 views

Text in layer toggler in Leaflet is really faint - why?

I have added a layer toggler using Leaflet and geojson but the text of layer names is too light to see in the toggler - how do I style the text in a darker colour? It's on a wordpress site, if that ...
0
votes
2answers
21 views

Adding a start and end marker to a GeoJSON linestring

I have a GeoJSON route that was created using ORSM which is as follows: var noelev = {"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[-84.477478,37.988621],[-84....
0
votes
1answer
547 views

Leaflet geoCSV Popup Customisation

I am currently using the leaflet geoCSV plugin to bring through CSV data into the map frame. I am struggling to be able to customise the popup to only show certain attributes of the CSV and different ...
2
votes
2answers
4k views

How to update data in Leaflet Control?

I have a Leaflet map with a control to switch between various basemaps or toggle on/off some overlay data. //Basemaps are all a-okay //Start with no polylines in my overlayData items = []; ...
2
votes
1answer
1k views

Popup with geojson data loaded using `Leaflet.FileLayer`

I'm trying to create an interactive map using the Leaflet.FileLayer plugin. This plugin allows me to load geojson files with description but I don't know how to show this description in Popup when ...
1
vote
1answer
404 views

Leaflet-Search plugin error

I try to connect Leaflet search plugin to my map with GeoJSON data. But i get error( When I enter a search query in browser inspector i get error: layer.getBounds is not a function in leaflet-search....
0
votes
0answers
36 views

Pushing features to external GeoJSON file

I am working on a project which uses Leaflet and leaflet.draw to show and draw shapes on the map. I also have a data.json file which I use to display former features generated from geojson.io. What I ...
3
votes
3answers
2k views

Making a GeoJSON layer editable with the Leaflet.Editable plugin

I'm new to Leaflet and the Leaflet.Editable plugin, but I'd like to make GeoJSON layer editable. When I mean "editable", I mean a user can stretch the polygons at will. Here is a good example of ...
0
votes
1answer
1k views

How to export shapefile using Leaflet?

I want a button "export" as I clicked on it the shapefile should be downloaded along with it's all files shp, shx, prj, dbf as zip folder. My project is GIS based in which I have two main tasks: ...
0
votes
0answers
36 views

Adding custom icon doesn't work in Leaflet?

I'm trying to add custom icon to a map. All seems ok but when I click to add markers on my map I get the Leaflet icon by default and not the one I liked to have. Perhaps is in the way I get the ...
0
votes
1answer
2k views

How to make the value showing on a leaflet heatmap like this one?

I'm attempting to use leaftlet.js, and heatmap.js (github.com/pa7/heatmap.js/) following this example: But I want to show the value on the heat map like this crime page (with two options on: "Crime ...
2
votes
1answer
30 views

How do I plot spatialpolygon dataframe layer on a leaflet map

I am not sure why this piece of code works library(leaflet) library(raster) adm <- getData('GADM', country='SGP', level=1) popup <- paste0("<strong>Name: </strong>", ...
3
votes
3answers
10k views

get latitude & longitude as per address given for leaflet

In my project I am using leaflet to display points. I am getting address from my database & want to show point for that particular address. I dident found anything which will give me latitude &...
0
votes
0answers
24 views

Leaflet info box error on same name properties in multiple layers

Following the 'interactive choropleth map' tutorial, I am able to create my own custom info box in a map with multiple layers. The properties called are within different layers. However, I have to ...
11
votes
1answer
7k views

Placing controls outside map container with Leaflet?

Can someone tell me how I can place controls outside of the map content with Leaflet? In this case, I just want to place the layer switch control outside the map object.
2
votes
1answer
2k views

How to get Leaflet layer control to work with GeoJSON files hosted online

I am having issues getting Leaflet's layer control to work if using GeoJSON files stored online, on Amazon Web Services. The points from the online file do show up with their popups as expected, but ...