Questions tagged [leaflet]

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

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

className of leaflet popup option does not apply to the intended DOM element

I have a problem similar to this post. Basically, the CSS is not applying to the element I am trying to target, and I cannot see why not: /* css file: */ .sitePopUp .leaflet-popup-content-wrapper{ ...
1
vote
1answer
193 views

Leafletjs, how to constrain dragging of a marker to a polyline?

Is there a way to constrain a marker so that when it is dragged, it moves along a given polyline in Leaflet JS? In my page I have route that is presented as a Polyline and a Marker. I want to be ...
1
vote
0answers
20 views

How to drag MarkerCluster spider?

I am using the leaflet MarkerCluster plugin. Can we lengthen and shorten the spider legs with drag and drop method in this plugin? or how can we make popups like this
0
votes
0answers
9 views

R Leaflet: Assign multiple groups to a layer to filter data and change column represented

I am trying to find a way in R leaflet to include overlay buttons which filters out groups in the data. I also need to include radio buttons which switch the column which is being represented in the ...
0
votes
1answer
20 views

Different Leaflet / Folium markers for different zoom levels?

I'd like to use, say, a circle or map pin when zoomed out, and for this to change to a polygon / shapefile when zoomed in (specifying the zoom level at which the change occurs). Can Leaflet do this?
3
votes
3answers
3k views

How do I zoom/Pan to a Leaflet Map, such that the given point is off-center?

In my Leaflet Application, on some event, I want to zoom to a particular marker, and then show it's popup. I have certain other custom components on top of the map, and the Popup that appears, is ...
1
vote
1answer
18 views

`folium.GeoJson` displays all polygons in GeoDataframe but not individual ones

folium.GeoJson displays all the counties of New York State: import geopandas as gpd gdf = gpd.read_file("Counties_Shoreline.shp") m = folium.Map(location=[43.062776, -75.420884], tiles="...
2
votes
3answers
273 views

Enable WMS GetFeatureInfo request in Leaflet using R?

I've been using R with Leaflet and Shiny to produce a web map that is accessible to the public online. It is a real-time air temperature map of Tasmania, Australia based on current Bureau or ...
47
votes
14answers
38k views

Converting ArcGIS Server JSON to GeoJSON?

I'm creating a web map using Leaflet, and I want to be able to grab feature layers from our ArcServer. I have successfully been able to retrieve a feature class as JSON, but Esri's JSON objects don't ...
0
votes
0answers
22 views

How to create a Legend with Points. Same size in Legend and Map. Leaflet

I am trying to create a Legend in Leaflet that contains the circles in the map. But, the size in the legend should the same size that it is in the map. My code is next. function getRadius(pop) { var ...
0
votes
1answer
35 views

Leaflet MultiLineString Popup and Tooltip Display Issue

I have a geoJSON layer of watercourses for which I want the multi line strings and also tooltips and popups to appear in a Leaflet map on instantiation. The below code will not display popups or ...
0
votes
0answers
24 views

Leaflet polygon labels not showing when pathOptions(clickable = FALSE)

I am creating a Shiny app which contains a Leaflet map. The purpose of the map is to select a polygon by clicking on the map, and then to draw a choropleth of results for the selected polygon. ...
-1
votes
0answers
33 views

R: How to get coordinates information at un-sampling and unknown locations in an area?

I have an atmospheric sampling dataset from a certain area like this: Rows: 100 Columns: 4 $ Pressure <dbl> 976.4521, 976.1801, 976.3160, 975.6355, 975.7716, 975.... $ Temp <dbl&...
7
votes
1answer
14k views

Displaying link in popup with Leaflet?

I'm working with the Leaflet JavaScript library. There should be an option to click on my map and view a popup. I already have a code for that: var popup = L.popup(); function onMapClick(e) { popup ...
0
votes
0answers
22 views

Updating sidebar on Leaflet

I have a number of markers on a leaflet map with a sidebar that is supposed to update with whatever markers are within the current map bounds. This is adapted from Bryan McBride's Bootleaf template ...
1
vote
1answer
39 views

Leaflet GeoJSON Polygon Label Remaining in Frame when Zooming

I have a polygon layer being loaded into Leaflet in GeoJson format. When using the code below I'm able to get labels for each feature to appear at the center but they remain fixed there. I'd like for ...
0
votes
1answer
22 views

geemap doesn't display attributions

Is it normal that geemap doesn't display attributions in my notebook? Is there a way to add them? I'm running : import geemap m = geemap.Map(center=[40,-100], zoom=4) m.add_basemap('CartoDB.Positron')...
0
votes
1answer
24 views

Adding to featureGroup asynchronously

I've run into this problem with Leaflet Map. I am trying to loop over some addresses, make a call for each loop to get the lat-long, plot on mymap, and group the markers to bound them using fitBounds ...
0
votes
1answer
47 views

ESRI-Leaflet updateFeature with a changed attribute or property

I'm updating a feature in ESR-Leaflet from a feature layer based on a call to a function. What I'm having trouble with is submitting this change to the feature service. Currently I: Get the feature ...
1
vote
5answers
13k views

Leaflet markerClusterGroup 'undefined is not a function'

I have to create a map with more than 5000 points from a geojson. So I would like to use markercluster plugin with Leaflet. I wrote the following code with help from the documentation and from other ...
1
vote
1answer
36 views

Display a gee featureCollection on a leaflet map

I'm using the python GEE api and ipyleaflet in a Jupyter Notebook and I'd like to retrieve an asset (FeatureCollection) and display it as an overlay on my map. The retrieving work just fine ...
0
votes
0answers
38 views

How to create a Web map? [closed]

I´m trying to create a Web Map and I attached the model that I´m looking for as reference. For this propose I tried 3 different ways: 1 - I used QGIS + PostGIS + PostgreSQL + GeoServer With this ...
0
votes
0answers
26 views

Styling 1 polygon with multiple colors in set ratios - Leaflet

I want to color my polygon with multiple colors basis user defined ratio in Leaflet. So lets consider an example: There is a rectangle (polygon) and the defined ratio is 60:40. Then in this case the ...
0
votes
0answers
19 views

Convert a ee.Geometry() into a Leaflet polygon

I'm using the Leaflet and gee API in a Python notebook. In this notebook I'd like to display a featureCollection as a layer on a Leaflet map. #retreive the asset asset_descripsion = 'Glad_' + ...
0
votes
0answers
17 views

Checking for image errors in Leaflet [closed]

I have a map with popups, and those popups display an image (in this case, screenshots from traffic cameras). The image sources are external URLs. Some of them work, others don't. The URL won't give a ...
0
votes
0answers
43 views

Coordinates not consistently reversed (lon,lat interpreted as lat,lon) in Leaflet

I have a polygon layer fed from GeoDjango + PostGIS as GeoJSON. Its original CRS is 3908. It's being drawn as a GeoJSON layer in Leaflet in CRS 4326 (I figure it is transformed on the fly by Django ...
2
votes
2answers
580 views

Joining CSV to KML/GeoJSON in Leaflet webmap and showing joined data in popups?

I'm trying to create a Leaflet/Mapbox webmap with line layer (GeoJSON or KML) with some IDs and data coming from the .csv (after joining through this ID) file located on the same path as the index....
1
vote
1answer
77 views

How does Carto make it possible to interact with elements on their tiles? Can I do the same with Leaflet?

I was looking at this Carto Map. You can click on a building and it shows some extra information about it. Then I noticed that these buildings weren't added as individual polygons or something like ...
1
vote
1answer
265 views

Map is not visible at initialization using react-leaflet

I have this react component: import React, { Fragment } from 'react'; import L from 'leaflet'; import { Map, TileLayer, Marker, Popup } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; const ...
0
votes
1answer
20 views

ArcGIS vector tile layer label gets underneath satellite image after pan or zoom esri-leaflet-plugin

I am trying to render on a leaflet map an ArcGIS vector layer and a satellite image layer using the [Esri Leaflet Vector Tile plugin][1]. The issue is that when I add those two layers the labels of ...
1
vote
1answer
813 views

L.control.sidebar is not a function

I have install leaflet-sidebar-v2 via npm. However when I try to simply initialize the side bar I get this error. L.Control.Sidebar is not a function. here is my index.html import scripts etc &...
1
vote
1answer
88 views

Leaflet control search clash with map.on zoomend function

I would like to know how to solve the clash between Leaflet control plugin and map.on zoomend function The problem is related to this query: Displaying selected layers depending on zoom in Leaflet ...
0
votes
1answer
54 views

Unable to Load ArcGIS vector tiles to mapbox-gl-leaflet

So basically I am using the mapbox-gl-leaflet plugin to render mapbox vector tiles on leaflet map. Now I am trying to load ArcGIS vector tiles in the plugin but the vector tile is not rendering on the ...
4
votes
1answer
1k views

Leaflet js style geojson layer according to zoom level

Leaflet js beginner following/adapting the choropleth example. I need to get something like this mapbox map where the feature styles change according to zoom level. I am loading a line geojson that ...
1
vote
0answers
19 views

Leaflet and tiler for R - can't get the correct tiles for displaying in Leaflet (wrong reference systeme or something)

I have got an issue with tiler (https://github.com/ropensci/tiler). I am setting up a webapplication and want to convert .grd files to tiles that can be read by Leaflet. This example can be easily ...
1
vote
2answers
402 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', ...
1
vote
1answer
618 views

How to rotate rectangle which fits in a circle in leaflet

I have a circle (in code its called "cyc_166_1") located at a certain angle with regard to another point. I would like to draw a rectangle which both fits in that second circle (bounds within it), ...
0
votes
1answer
746 views

Leaflet Routing Machine show option doesn't work

I am adding route to the map and I want to hide instruction (turn left, turn right etc.) but I want to show them later. As I can see there is parameter show for that. If I set show: false I see white ...
2
votes
1answer
100 views

Can leaflet be used to show 360° panoramic images?

Google's Marzipano makes the task of creating VR tours extremely simple.It is possible to take the Marzipano output and customize it - to an extent. However, Leaflet with its pleathora of plugins and ...
0
votes
0answers
70 views

Programmatic way of accessing mapbox tileset from leaflet WITHOUT studio

I have a R shiny app that successfully uses leaflet to interact with a custom mapbox studio style. mapbox_url = "https://api.mapbox.com/styles/v1/bweinstein/ck94nmzn20an31imrz6ffplun/tiles/256/{z}...
2
votes
2answers
2k views

Reason for “L.Control.Draw is not a constructor” error?

Below is my code: <!DOCTYPE html> <html> <head> <title>Simple Leaflet Map</title> <meta charset="utf-8" /> <link rel="stylesheet" ...
3
votes
1answer
590 views

Receiving data from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet-tilelayer-geojson/ A php script answers ...
1
vote
1answer
26 views

L.divIcon and aria-label attribute

I have three type of layer and for each layer a different marker, which I styled in CSS. The problem now is, that if someone uses VoiceOver or something like this, it's reading the 'html'. In my case, ...
1
vote
2answers
90 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
1answer
101 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 ...
1
vote
1answer
55 views

Filtering on multiple features with the use of L.control.layers so that the checkboxes are within the map

Working with leaflet.js. I'm trying to incorporate multiple filters in L.control.layers. I have a working layer control for changing basemaps and layers of markers with different years, but I would ...
0
votes
1answer
61 views

Display shapefile data - Leaflet 1.4.0

I'm a new member and a beginner with Leaflet and JavaScript. I try to display shapefile data on my webmap with Leaflet. But it doesn't work. All the data (.shp, index.html... ) in WGS84 are on my ...
0
votes
1answer
177 views

White sides at marker popup

I like Leaflet a lot. But I want to ask how to remove white sides in the popup? I manage to turn of padding but it only removed top and bottom, but sides still stand. I will insert a image and it will ...
1
vote
0answers
11 views

GetFeatureInfo with leaflet.extras2 and Shiny

I am building an R Shiny App that utilizes the following WMS. However, the GetFeatureInfo capabilities for click-enabled popup (leaflet.extras2 functionality) returns a summary of the GetCapabilities. ...
4
votes
1answer
481 views

Pass variable value from Geojson file to filter another Geojson layer Leaflet

I have an leaflet map with 2 geojson file loaded locally using the leaflet ajax filter. I am trying to filter the second geojson (polyline) based on 'click' of any of the first geojson point feature. ...

1
2 3 4 5
66