Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
23 views

Leaflet page scrolling issue on iOS

I am currently using Leaflet 1.6.0 stable version. Everything works fine except the page is preventing scroll on iOS phones (tested on Safari & Chrome). I have done some workarounds via this ...
1
vote
1answer
23 views

Find the right values for bounds and origin for Proj4Leaflet

I'm using Proj4Leaflet to use tile layers with a different CRS (EPSG:25832) in my leaflet project. Now I am somehow lost in finding the correct values for the bounds and origin of the tiles I want to ...
0
votes
0answers
12 views

Use different marker in leaflet for feature with max/min property value

I'm building an application that needs to make the feature with the max/min value in a given property more visible to differentiate it from the rest. I was wondering if it was possible to change the ...
0
votes
1answer
19 views

Adding featureOver on map for multiple layers using carto.js and leaflet

How can I add featureOver on map for multiple layers(layers added dynamically) using carto.js and leaflet. This functionality have worked only for one layer. Here is my code: layer.on(carto.layer....
0
votes
0answers
21 views

Add search control to a markerClusterGroup [closed]

I want to add a search control looking for features stored in a geojson. I tried the solution used here but it does not work on my computer. Can you tell me where is my mistake ? Here is my code : /...
2
votes
1answer
33 views

bringToFront() not working on tooltips in Leaflet

I have a Leaflet map that includes polygons and data from a GeoJSON file. I have permanent tooltips for each polygon that include data for the user to see. But there are so many tooltips that ...
0
votes
0answers
20 views

Vue2 leaflet style choropleth map Function on GeoJSON

I would like to add a function to my Vue.js Leaflet map to have a choropleth map. This is the example: https://codesandbox.io/embed/great-sea-4qyvc?fontsize=14&hidenavigation=1&theme=dark I ...
0
votes
0answers
25 views

Removing a layer (markerClusterGroup) [closed]

I have create a map consisting in a GeoJSON points layer displayed using a markerClusterGroup variable. Next to my map, I got a button on which a click should remove my layer. Here is the code : &...
1
vote
1answer
33 views

Showing selected entities on a Leaflet map from onclick action within a <div> [closed]

I have displayed a layer of points using Leaflet. Here is my script embedded in the HTML code : var map = L.map('map', { center: [45.7604276, 4.8335709], zoom: 13 ...
1
vote
0answers
41 views

How to reproject data from [-180 180] to [0 360]? [duplicate]

I have both a GeoJSON and shapefile of volcanoes along the Pacific Ring of Fire. The area I want to render in the map is right around the antimeridian, so Leaflet cuts it in half. I initially tried to ...
1
vote
1answer
36 views

Converting CRS in GeoJSON file from user defined CRS to EPSG 3857 and EPSG 4326

I have GeoJSON file which is obtained from conversion of shape file in QGIS3.10.0. Originally it was created by survey data of electronic total station. Geometric coordinate system then converted to ...
-1
votes
0answers
25 views

Leaflet maps with a dark theme style

I have not seen many leaflet maps setup with a dark theme where maps are dark-grey-black, the tools - control layers are white with darkish backgrounds. Would love to see some samples as I'm looking ...
-1
votes
1answer
28 views

Change the data for the chart

I've used this code: Leaflet and Popup with D3 for my Leaflet project. The problem is, I don't understand how I can change the data. I don't need months in the chart but something else. Where in the ...
1
vote
1answer
35 views

Leaflet change from JSON to CSV

Still to new to Leaflet but with small steps.... I will get somewhere. I am loading now with jquery.getjson (and this works fine) // Load the data jQuery.getJSON("data/lieux_culture_nantes.json", ...
-1
votes
0answers
22 views

Leaflet map with multiple search boxes subfiltering and autosuggest [closed]

I would like to create a leaflet application with multiple search boxes. The first search box should create a subset of the data. So when I search in the second search box I can only use the results ...
0
votes
0answers
33 views

Leaflet Slider to move automatically? [closed]

I'm currently following this tutorial: https://github.com/dwilhelm89/LeafletSlider And after successfully implementing my own, I was wondering if it's possible to have the slider move automatically ...
1
vote
1answer
39 views

Showing users current location with Leaflet [closed]

I am currently trying to show the users current location like the way google maps shows you as a blue dot when you are viewing it. I have got this code from a similar enough question however I keep ...
1
vote
2answers
35 views

Leaflet markers from CSV with multiple columns employing omnivore [duplicate]

Goal: Show markers for lat-lon positions from a CSV file. The other columns need to be placed in pop-up as attributes. CSV file can be seen at: airport.csv Code: headers = ['iata', 'title', 'city', ...
0
votes
0answers
32 views

Leaflet markers on click go to URL

Hello I've made this code for a static one image map with markers. I have to make it so each marker sends you to a specific URL for navigation. Can anyone please help me on how I would be able to do ...
0
votes
0answers
29 views

Leaflet draw - Edit event after editing existing feature

I was inspired by this post How to edit an existing layer using leaflet? I can click on an item to make it editable. But this does not "activate" the drawControl to allow me to click save or cancel, ...
0
votes
0answers
23 views

Interactively Display Values of a Heatmap.js leaflet.js Heatmap Layer

In this example of the heatmap.js tool, I see how the values of the heatmap is returned by using heatmapINstance.getValueAt(): demoWrapper.onmousemove = function(ev) { var x = ev.layerX; var y =...
0
votes
2answers
39 views

Why is the background of my Geoserver WMS+Leaflet example grey instead of transparent?

I am trying to add a WMS layer to my leaflet map. When I add the layer it shows up but the the outside of the layer is grey instead of a world map. This is my code: <!DOCTYPE html --> <...
1
vote
1answer
30 views

How to display tiles from a GeoWebCache cache directory in Leaflet?

I'm trying to publish the cached data in geoserver with a leaflet. However, the data does not appear when publishing the cached data. var map = L.map('map').setView([55.42, 53.50], 6); var wmts =...
-2
votes
1answer
58 views

Leaflet: how can I move a bounding box to a new center?

How could I move a bounding box to a new center using Leaflet? There is a getCenter() method, but not a setCenter() one...
1
vote
2answers
51 views

Calculating a bounding box by its center point and ratio, the map zoom and desired pixels width in Leaflet?

I'm trying to add dynamically an overlay on a leaflet map. I know the overlay center - {lat:50.8466,lng:4.3528} overlay ratio - 16/9 map zoom - 15 desired pixels width - 200px How can I calculate a ...
2
votes
1answer
54 views

Simplified lines disappear in smaller zoom levels in ArcGIS JavaScript v.4.14 map

I have a GraphicsLayer on ArcGIS js map with many lines of varying lengths (1 to 200m). However, in smaller zoom levels the short lines disappear. For example, in the images below the red lines are ...
1
vote
0answers
18 views

Opening hyperlinks in a new tab from GeoJSON points when the link to the website is embeded in GeoJSON? [closed]

In the code below the point links are embeded in GeoJSON object places_geojson. How could we make the link to be opened in a new tab? I believe that this functionality need to be added in the ...
0
votes
0answers
15 views

Custom MarkerClusterGroup icons according to the points within the group [duplicate]

I would like my icons of my MarkerClusterGroup to be determined according to the content (all poi) of the group. My object: var villes = { "Paris": { "lat": 48.852969, "lon": 2....
0
votes
0answers
28 views

OSM topographical tiles with no labels or human features?

I'm looking for Open Street Map topographical tiles with no labels. I've gone through all the Basemaps based on this: https://ipyleaflet.readthedocs.io/en/latest/api_reference/basemaps.html I need ...
1
vote
0answers
34 views

Leaflet Cluster Number as Variable [closed]

I'm looking to make a map using Leaflet in R, where the clusters shows the sum of a variable associated with the markers, instead of the number of markers in the area. For example: If there are 4 ...
1
vote
1answer
27 views

Changing circle marker color in Leaflet

I use the following code in order to change the fillColor of a marker within my leaflet-client, as suggested on this post: https://gis.stackexchange.com/a/124928/20297 var marker = marker = L....
0
votes
1answer
33 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
24 views

Information about Leaflet and MapGuide [closed]

I want to make interactive maps online/on a server but not sure whether leaflet or MapGuide program is better for me to delve into. Which software will allow me to render resource intensive layers ...
2
votes
1answer
60 views

Integrate sidebar with Python generated Leaflet map?

I have this map: link It was generated through Python code, not via JS directly. I want to add the Leaflet sidebar plugin within it, but it doesn't seem to work. As you can see in the github repo ...
3
votes
1answer
69 views

Leaflet centering map on GeoJSON

How can I automatically center the map view on the drawn GeoJSON? My GeoJSON can either contain a polygon or multiPolygon feature. I'm drawing the following GeoJSON onto my Leaflet map: let ...
1
vote
1answer
42 views

Working in projected coordinates rather than lat/long inLeaflet

I'm using proj4js to use the utm33N coordinate system. Leaflet works with latlong, is there anyway for it to work in the projected system, so I can for instance set the centre location based on ...
1
vote
0answers
41 views

Esri Leaflet refresh() method not working

I'm looking to refresh a featureLayer in Esri Leaflet with the refresh() method (API reference: https://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html). I set up a button to ...
2
votes
1answer
34 views

Leaflet tiles are not loading for multiple Bootstrap tabs

I am making a web app for different areas using Leaflet library. I have different Bootstrap tabs, each tab opens a new map of a new area. The problem I am facing is that the tiles on the first tab ...
2
votes
0answers
45 views

Passing Leaflet object geometries to a parametric SQL view in GeoServer

I have a parametric SQL view for a WFS layer in GeoServer with the simplified form: SELECT pts.id AS id, pts.geom as geom FROM schema_name.points_table pts WHERE ST_Contains(%g%, pts.geom); I want ...
1
vote
0answers
25 views

Loading MarkerClusters while the bounding boxs changes position and display

I'm using Leaflet.markercluster plugin and JavasScript to develop a map where i want to generate clusters according to the screen bounds. I have a service that returns me a list of points depending on ...
2
votes
0answers
34 views

Why is my eventlistener not listening to some tiles of the map? [closed]

I have a Leaflet map on a page that I developed as part of a school assignment. The ID of the map element is mapid. I have added mouse listeners to mapid. When I enter the area of mapid on my page, ...
0
votes
0answers
19 views

Trouble eliminating white, no-data pixels on raster image in Leaflet.js, served via GeoServer [duplicate]

I asked this question originally on StackOverflow here, but someone suggested I post to the GIS StackExchange, instead. I'm learning leaflet.js, and want to be able to create a web map that can be ...
2
votes
0answers
24 views

How to develop responsive layer container in Leaflet?

I'm using leaflet.js to develop a drawing layer tool with the full-page map. Users will draw a group of layers to describe an industrial product's parts. The leaflet map and its layers should be fit ...
1
vote
0answers
31 views

How to add the mapview layers in Leaflet maps in r shiny app?

server <- function(input, output){ output$map <-renderLeaflet({ df_data <- uploadshapefile() ... df_data <- as.data.frame(df_data) df_data@data$ id <- nrow(df_data) lm....
1
vote
1answer
25 views

What are the bugs in this code using leaflet-heat + leaflet-sync?

I am trying to use Leaflet.Sync. I want to show in the first map, a heatmap created by projecting an array of points (by using Leaflet-Heat). And at the second map, I want to visualize the same array ...
5
votes
1answer
183 views

Leaflet + GeoServer WFST - Inserting Polygons to PostGIS database

I have a GeoServer installation on top of a PostGIS database. I am trying to set up a leaflet webmap (using Leaflet WFS-T plugin) so that I can insert, update and delete polygon features. I have ...
1
vote
1answer
33 views

How can I use custom style from MapBox with leaflet L.vectorGrid.protobuf

I have a custom style, that I made in MapBox. I don't have it in a digital version. How can I use it with leaflet? From here I understand how to add it. But I still need to apply styles. From this ...
2
votes
1answer
46 views

How to get Leaflet map.hasLayer(label) instead of map.hasLayer(layer)

I want to get label of the layer selected in option control in order to know which thematic analysis to run. because I have just one layer, but different fillcolor regarding the label in the list ...
1
vote
0answers
51 views

Limit API request to zoomed bbox

I am working on a forked OSM/leaflet/overpass API application which has its own max bounds declared var mapBounds = { south: 50.8025, west: 0.3724, north: 50.8785, east: 0.5290 }; var LBounds = L....
1
vote
0answers
30 views

Bounding box in Leaflet

I am currently writing a app in R / Shiny where I use Leaflet. Background layers are WMS and it works fine for most services without specifying any projection anywhere. When using fiddler I see that ...

1 2 3 4 5 63