Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Make a featureGroup with a layerGroup that is also editable in Leaflet?

I have a Leaflet map with a featureGroup, a layerGroup and drawControl however only the featureGroup is editable using the drawControl. I think its because the layerGroup is separate from the ...
1
vote
2answers
20 views

Variable substitution with environment variables in SLD and GeoServer

I'm posting this as a new question as a follow-up to this one Geoserver SLD: Dynamic Variable Substitution I am struggling to get SLD variable substitution to work where I have an environment variable ...
2
votes
2answers
937 views

Stop Leaflet event propagation?

I have a feature layer and some pins on it, with mouseout, mouseover events callbacks on the feature. When the mouse is over the pin icon, that triggers mouseout event (mouseout from the feature layer)...
0
votes
0answers
6 views

Cluster points in GeoDjango using Leaflet

Am trying to cluster point in Leaflet from the data created in backend geodjango.I have converted to geojson format to be able to visualize. #views.py def data(request): data=serialize('geojson',...
0
votes
1answer
184 views

Can't close custom popup at fixed position

I created this custom popup at a fixed position. When clicking a marker a popup opens, I'm able to close the popup and open another one clicking a different marker, then I'm not able to close the ...
2
votes
1answer
157 views

Struggling to find a shiny workaround to flush data from $finished while using EditMod in the mapEdit package

This is a crosspost from the mapedit issues github page here. I am attempting to build a shiny app that allows a user to plot a subset of data after selecting polygons using the mapedit package. While ...
0
votes
1answer
735 views

How to add data slider bar control to Folium maps

I am making a choropleth map in Folium which displays data for certain age brackets. I would like to add a double ended slider letting users select the bottom and top of the age range to view. The ...
0
votes
0answers
30 views

Using WFS and Leaflet

I'm quite new to Leaflet, and i would like to use this WFS, https://wxs.ign.fr/agriculture/geoportail/wfs?SERVICE=WFS&REQUEST=GetCapabilities, to display interactive agricultural plots on a ...
0
votes
0answers
67 views

Qgis2web filtering clusters with Leaflet output

I'm using the Leaflet output option on qgis2web. However, when I select the 'Cluster' option for my exported layers, the 'Attribute filters' that are created don't appear to update the displayed data /...
2
votes
1answer
117 views

GeoJSON file content not display properly in Leaflet

I am new to Leaflet. Am facing one issue when try to display GeoJSON file in Leaflet. Issue: Actually some GeoJSON file only am facing this problem. In my knowledge coordinates are in different ...
0
votes
1answer
27 views

Adding WMS (IGN) to Leaflet

I'm using Leaflet to display agricultural plots obtaine frome a WMS. Here is the link to the WMS : https://wxs.ign.fr/agriculture/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=...
0
votes
0answers
30 views

Leaflet map If/Else condition error [closed]

I have a Leaflet map with a canvas that I want to display a rectangle on. I would like the rectangle to adjust according to the zoom level. My attempted solution is as follows: <div id="map&...
0
votes
1answer
39 views

Leaflet Tilelayer from Mapbox with URL restrictions

I’m having great difficulty with this topic. I’m building a Gatsby/React mapping web app for the Swiss paddlesports community (GitHub repo) using Leaflet to load a custom tile layer from Mapbox. I’d ...
0
votes
0answers
37 views

Create an event when clicking a button within Leaflet.StyleEditor pluggin [closed]

I am using Leaflet.StyleEditor plugging https://github.com/dwilhelm89/Leaflet.StyleEditor and I would need some help. I already asked the question on the GitHub of the project but it seems not to be ...
1
vote
1answer
20 views

Dynamically change Leaflet PopUp Background on updating PopUp content

I have a function that sets new content to the Popup and opens it whenever the function receives data from the socket. layer[i].getPopup().setContent(content) layer[i].getPopup().options.autoClose = ...
0
votes
1answer
17 views

How to display all the column values of overlapping polygons in leaflet popup with R?

I have intersected points data with a grid in which I would like to display the name of all the species found in every cell. Code sample: library(dplyr) library(rgdal) library(leaflet) library(sf) ...
0
votes
1answer
905 views

Edit a shapefile with Leaflet.pm

I am new to Leaflet but so far so good. I managed to add the plugins I needed and they work. Except the shapefile editing. I am using leaflet.pm to draw, snap, cut polygons (only polygons). I also ...
2
votes
3answers
3k views

Default Leaflet icon is not showing

I want to use default icon provided by leaflet instead of using something else. But unfortunately i am not seeing anything, not even error. var myIcon = L.icon({ iconUrl: 'my-icon.png', ...
0
votes
1answer
16 views

Make text color in innerHTML change depending on value in GeoJSON

When I hover over different counties on my map, a div updates whether or not the county voted republican or democratic in the 2020 election (among other things). It will either say it voted republican ...
0
votes
1answer
155 views

Show WMS information in popup on Leaflet map?

I need to view WMS information through a popup in Leaflet map. I tried with the code below, but the popup doesn't come out with information, but automatically downloads a file. map = L.map(document....
0
votes
1answer
132 views

Esri-Leaflet getFeature returns 'undefined'

I'm using Esri-Leaflet and whenever I try to use getFeature() the console.log returns "undefined". There are no other errors to accompany the undefined message. var service = L.esri....
2
votes
1answer
816 views

Layer.bindTooltip doesn't work in Leaflet

My objective is to plot polygons and assign a tooltip label to each one. For some reason, my code doesn't seems to work. poly_geojson = L.geoJson(poly_gon,{ onEachFeature(feature, layer) { ...
0
votes
1answer
102 views

Adjust pop up container in Leaflet

I have a problem wit my current project. When I export my QGIS Project via qgis2web there is a strange behaviour of the map pop ups which are not fitting the content. It sometimes cuts the container ...
0
votes
0answers
29 views

Geofences in Leaflet with live Location

I'm a newbie in terms of programming. I'm building a Web App with Angular and Leaflet, which has to locate the users position and notify him in case he is close to specific buildings. There a several ...
1
vote
1answer
115 views

How to set the same size between GeoServer and Leaflet?

The right Map is a layer from GeoServer (I set the CRS as 4326) in the left is the result of the Leaflet code (here a linked the GeoServer layer to publish in the leaflet map), as you can see in the ...
0
votes
1answer
54 views

Page becomes unresponsive

I created a html file using leaflet to add markers to leaflet map using csv data. For parsing csv data I used papaparse. I did the same thing with python folium too and saved the output to a file ...
1
vote
1answer
46 views

Connect corners of two rectangles via SVG line in Leaflet

Assuming I have two rectangles on a leaflet map with CRS.Simple, how can I use svgOverlay to draw a <line> that connect top left corner of the two rectangles? I'm having issue with spatial to ...
4
votes
1answer
56 views

Variable nested inside another variable not displayed properly in popup in Leaflet

I would like to set my popup content. Some of the information will be condition-based. I tried the following options: onEachFeature: function (pointFeature, layer) { var stream = function(liveStr){...
5
votes
2answers
98 views

Styling popup with two separate styles at once in Leaflet

I have the point layer as you can see below: where the semicircles are fine but points not necessarily. I would like to customize these points as well. The problem is, that I can't find a good option ...
13
votes
5answers
25k views

Changing layer order in Leaflet

I would like to be able to change the order of the layers in Leaflet. I tried implementing two Leaflet plugins in order to change the layer order. First I tried leaflet-control-orderlayers, which ...
5
votes
5answers
2k views

Where to host private CartoDB/Leaflet web app

I am looking for suggestions/recommendations on where to host my cartodb/leaflet map site. It needs to be private with authorized users and have a document management system. So, I was thinking ...
0
votes
1answer
48 views

Use of Leaflet to display raster image from WMS GeoServer

I'm trying to display raster images from GeoServer on a Leaflet map. Simply like this: var map = L.map("mapid").setView([15.6261, -61.44361], 13); var wmsLayer = L.tileLayer.wms('http://...
0
votes
1answer
49 views

Issues with Leaflet and WMS map BoundingBox

Our application uses Leaflet to display various kinds of maps (TMS, WMS, WMTS, XYZ etc.) as well as GeoJSON objects on the map. The problem is in how we define and use the WMS maps and layers. We're ...
0
votes
1answer
727 views

Getting width of road segment given its end points using Leaflet?

I want to highlight a road segment on a Leaflet Map. I have the coordinates of the end point of the road segment, so could plot it as a linestring. But the problem is how can I get the width of the ...
1
vote
2answers
191 views

What is this coordinate system from ESRI and how do I convert it to regular coordinates for GeoJSON Mercator?

I downloaded the ArcGIS health region boundaries file in ESRI Lambert Conformal Conic format here: https://www150.statcan.gc.ca/n1/pub/82-402-x/2018001/hrbf-flrs-eng.htm Using mapshaper.org I ...
6
votes
1answer
34k views

Changing style of marker in Leaflet(from GeoJSON)

I'm serving GeoJSON to Leaflet and by default it get a blue icon marker. I'm trying to change the style so I'll be able to use the feature properties as part of the style , but no matter what I do , ...
0
votes
0answers
17 views

PostGIS raster dynamic styling on Leaflet map

We are currently using GeoServer to load a raster from PostGIS onto map. But we need some other way, so we can dynamically change its styling. We want to add a color slider on a Leaflet map by which ...
0
votes
1answer
91 views

Drawing on Leaflet map give incorrect coordinate

I am using Leaflet and OpenLayers. When I draw a bounding box I am getting the correct lat and lon if I use OpenStreetMap tilelayer. When I switch to using EarthData tilelayer the bounding box is ...
0
votes
1answer
50 views

Leaflet & special characters

I have a problem regarding Leaflet and calvinmetcalf's shapefile module. In my shapefile I have fields and in those fields are strings like: 'Frankfurt' 'Tübingen' 'Géramer-sur-Mer' You see that due ...
0
votes
0answers
45 views

Dynamically scale line weight in Folium (polyline or antpath)

I draw lines and ant path in folium and I need to scale width of line for example 12 km width line but I can't use simple weight because it has dynamic width that changed when zoom in or out loc = [[...
0
votes
1answer
34 views

Loading data from array in popup when country is clicked in React Leaflet

I'm newbie and I have interactive web in react using leaflet library and now I need to load "title" data from array to a map. So when I click on some country, popup will show up with this ...
1
vote
1answer
481 views

Add polygon (buffered line) created by turf.js to map in Leaflet?

I am trying to create a buffered line layer by creating GeoJSON line string from routing line and buffering it with turf.js and then show it on the map. Here is my code: route.on('routeselected', ...
1
vote
1answer
25 views

Turf.js dissolve features not adding to Leaflet map

Trying to dissolve features with boundaries that touch with Turf.js. They all have a common attribute that is specific in the Turf option example. Console loge console.log(regionsDissolved) results in ...
2
votes
2answers
2k views

Leaflet JS - open popup on button click

New to JavaScript, coming from Python background. Created a custom control and have added buttons inside the _div using a for loop and innerHTML. I want to zoom to and open the popup of a layer of ...
4
votes
2answers
7k views

Dynamic tooltip update leaflet

How can I make my tooltips update when I change years on this map? http://argis.ualr-iea.org/dash_new_design/uninsured_map.html Using the select box, I can get the style to change but I can't figure ...
1
vote
1answer
21 views

Bind tooltip to a marker as a result of turf.js distance method in Leaflet

I'm trying to simply put the results of the distance variable in the tooltip but keep getting undefined. I don't understand what's happening. function findDistanceToCentroid(countyPolygon, ...
1
vote
1answer
87 views

Dynamically changing fillColor variables in leaflet

When I want to style a polygon using a property the traditional way is to assign a function that returns a style object. Within that object you assign the fillColor property to a getColor function ...
2
votes
1answer
595 views

Picking up the coordinates inside this polygon draw

I already have a geojson being consulted and that is plotting these black dots. And then I inserted the leaflet-geoman plugin to give users the freedom to create polygons on the map. Basically draw ...
1
vote
1answer
408 views

VueJs Leaflet Get Color Function

I am using VueLeaflet to create a map like in this example: https://vue2-leaflet.netlify.com/examples/geo-json.html I like to add some colors to the polygons like in this example: https://leafletjs....
1
vote
0answers
88 views

Using spTransform CRS in Leaflet

I am producing Kernel density estimates for animals from tracking data. Location is input at x y data, I produce a spatial polygons dataframe from these coordinates. xy<-id[c("X", "Y&...

1
2 3 4 5
74