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
39 views

Converting zoom level rule-based styles to mbtiles?

In QGIS I have made a zoom level rule-based style (.qml) with OpenStreetMap data stored locally for a specific area. Is it possible that I convert these styles (or the project) as mbtiles so that I ...
1
vote
1answer
46 views

How to remove the leaflet L.control.watermark from the map

I tried to add a picture to the map by using a button. This works well by using L.control.watermark. But I want to remove the picture at the next button click and I can´t find a working solution. ...
0
votes
1answer
39 views

Leaflet : Differentiating colors dynamically

Here's what I want to do: Show all features of the GeoJSON file using Leaflets. Connect to the database, in a database there is a table that has an ID column that matches the GeoJSON file feature, ...
3
votes
0answers
45 views

Plug in / API for getting sea routes with leaflet

I am developing a maritime routing application prototype with Leaflet.js for my company Deep Blue Globe and using the windy interface. The problem is since windy uses Leaflet version 0.7.7 there are ...
1
vote
1answer
119 views

Multiple on-the-fly filtering based on markers' features on leaflet

I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at ...
0
votes
1answer
41 views

Nothing happened when call function remove layer on leaflet

I'm tryng to call function for clear layer. But nothing happened, using this <li class="list-group-item"> Remove All <div class="material-switch pull-right"> <input ...
0
votes
2answers
77 views

Changing Leaflet Base CRS using Proj4js

I am trying to change the CRS of a web mapping service in Norway. The projection is EPSG:25832. Here is the WMTS service: https://kartkatalog.geonorge.no/metadata/norge-i-bilder/norge-i-bilder-wmts-...
1
vote
2answers
39 views

Getting current EasyButton state

I am using an EasyButton for showing a sidebar in a Leaflet map. Now I want to restrict the functionalities inside the sidebar in that way, that they only are accessible when the sidebar is opened. My ...
0
votes
0answers
37 views

How to manually control react-leaflet popups (via props) within a GeoJSON layer?

I'm using react-leaflet to render a GeoJSON feature collection that has points and linestrings: I was able to get the click and hover events on the actual features themselves to work just fine. But ...
-1
votes
1answer
39 views

Transferring data from layer to layer in Leaflet [closed]

I use Leflet maps and I want to import data from layer to layer If the first layer is points and the other polygons I want to get the data from the polygon layer to the points if the layer of dots is ...
1
vote
1answer
82 views

Changing marker symbol in Leaflet AJAX

I have got a .json file to display in Leaflet map.The points are shown with custom blue dot markers. I cannot get to change them.How do I get to change the symbol? var greenIcon = L.icon({ ...
0
votes
1answer
154 views

Automatically refresh Leaflet Markers from MySQL

I have a leaflet map that loads marker details from a MySQL database. I have a timer that clears and reloads the layers (and therefore markers); however; it doesn't seem to be refreshing the data. ...
0
votes
1answer
104 views

How to get polyline coordinates in Leaflet

Using leafletjs, I created a polyline connecting a bunch of markers: var line = L.polyline( latlngs, { weight: 5, color: '#8EE9FF' }) Now, I am trying to get the start and end markers when I ...
0
votes
0answers
38 views

Including iframe in tooltip in Marker?

Can we include an iframe in tooltip in Marker? import folium var=open("yolo.html", "r") var2 = var.read() map = folium.Map(location=[19.179180,72.972580],zoom_start=6, tiles="Mapbox Control Room") ...
0
votes
1answer
68 views

How Leaflet makes request to get the tile image

I have used Leaflet in my web app for a while. And I studied the source code, but didn't find the code or function for sending HTTP request. If I missed the code, which part is for this function? If ...
0
votes
1answer
40 views

Programmatically add className to GeoJSON feature Popup in Leaflet

I'm trying to add a className to a Popup with a function, but when I use a function, the code of the function itself gets returned. What am I doing wrong? function popUp(layer){ return '&...
0
votes
1answer
76 views

Dynamic CQL filter in leaflet.js

Tell me, please, how I can apply cql_filter, based on currently map location in leaflet.js. I have following code: var myLayer = L.tileLayer.wms("url-to-geoserver", { layers: 'heatmap:layer', ...
-1
votes
1answer
54 views

Remove rectangles from Leaflet map

I am drawing a Leaflet map. I also want the ability to add the coordinates via a form. How is that done? leaflet map
1
vote
1answer
55 views

Showing KML data point info as popup in Leaflet?

I'm new in Leaflet. I'm using Leaflet as my base map. I have a lot of points as a KML file. I used GeoJSON & omnivore.kml(...) to load my KML file. Every thing is ok and it loads perfectly. My ...
0
votes
1answer
37 views

Leaflet + Polymer 2 map loading with distorted tile

I am struggling for some time now to get the leaflet map loaded properly within Polymer 2. I have searched various threads in SO: this, Github: this, this and several other posts, unfortunately still ...
1
vote
0answers
49 views

Disable editing after commit in Leaflet.Editable [closed]

I'm using Leaflet.Editable to draw polygon on my map, but I don't want to edit the polygon that I'm drawing. I want it to be fixed on my map. How can I do that?
2
votes
1answer
70 views

Leaflet Search: cannot search for Point types

I followed this repository Leaflet Search and I want to combine search box, using polygons, polylines, and point. for polygons and polylines is working fine. But not for points. The property Name ...
0
votes
1answer
43 views

Remove L.esri.query featureLayer from map ESRI Leaflet

Using ESRI Leaflet I am adding markers to the map from an ArcGIS online feature service. I do this using the L.esri.query method similar to: function slideChange(time1, time2, service) { L.esri....
1
vote
0answers
91 views

PostGIS - Dynamic Server-Side Clustering based on Zoom level

I'm working on a Ruby on Rails application that is showing road signs on the map(leaflet). So, user can browse map and road signs, great. But, if there are a lot of signs and user wants to zoom out, ...
0
votes
1answer
48 views

WMTS map with different origins for different zoom levels

I have WMTS map and I'm using proj4leaflet for nonstadard crs. This map has different origins for different zoom levels. First two levels have the same origin, then the next two levels have also the ...
0
votes
2answers
145 views

L.Control.Search: Using looping for searching data on Leaflet

Is there a way to find data from different layers and different propertyNames? I have several GeoJSON data files, with different properties. At this moment I can only search one GeoJSON. For looping ...
1
vote
0answers
38 views

Leaflet - two colors same path

Wanted to know if is there a way to get a single path (line) to have 2 colors? for example one next to each other I want to display 2 different paths (multi poly-lines) at same times, and each one ...
1
vote
1answer
109 views

Leaflet map shows no markers for GeoJSON

Following the example below I try to add an external GeoJSON to my Leaflet map, but its markers don't appear on the map. I use this file GeoJson. Any explanation? https://maptimeboston.github.io/...
0
votes
1answer
46 views

Real time changing status of a point, web mapping [closed]

I’m new to web mapping and developing and I try to make a web map with points. The points are bank ATMs. The points will change color depending on their condition. There will be three different colors ...
2
votes
3answers
436 views

Import local GeoJSON file into Leaflet

I just used a leaflet. From the geoJSON demo page I saw if you want to include data you have to use <script src="data/us-states.geojson"></script> and if you open the files looks like ...
1
vote
0answers
86 views

Convert coordinates with Proj4Leaflet from EPSG:25832 to leaflet 3857

I have a wmts server, and try to add this tiles to leaflet with proj4leaflet. My code is here //this one is fine var main = L.tileLayer( 'http://****&zoom={z}&x={x}&y={y}',...
0
votes
1answer
25 views

Get tiles to appear after fitBounds call on one marker on mobile only

I am making a Leaflet 1.3.4 map. When I added fitBounds to the code, I experience a problem when viewing the map on my iPhone XS. Map displays fine on the desktop but regardless of browser (I have ...
0
votes
1answer
45 views

Display leaflet layerswitcher on click event

I would like to click on a sidebar/menu icon, and when I do the layerswitcher Icon should appear. Right now the layerswitcher is always displayed. I know how to make it disappear with the command ...
0
votes
1answer
78 views

FitBounds after L.GeoJSON.AJAX has loaded

I am making a Leaflet 1.3.4 map that will show members based on category. I have a php file "cs.php" that queries a MySQL and returns an option menu of distinct categories. When a category is selected ...
0
votes
0answers
56 views

Highlighting map areas through map legend using Leaflet?

I would like to highlight different areas on a choropleth map when the mouse over the legend using Leaflet, but my code is not working: <head> <meta charset="UTF-8" /> <meta ...
0
votes
1answer
71 views

Removing leaflet Tooltip from L.geoJSON layer

I'm aware that there is unbindTooltip(). But I am not sure if that will work in my case. The first problem may be the fact that I need to convert it out leaflets geojson format? The second problem ...
1
vote
0answers
85 views

How to change the layer selection view from Radio button to Image in Leaflet

I have implemented the below example to show the multiple base layers of map in my application using LeafletJs. Leaflet JS LayerGroup example I'm able to successfully implement the same but I'm ...
2
votes
1answer
49 views

List table names within PostGIS bounding box

So I have a bounding box drawn by the user on Leaflet from which i can get features of specific table as follows SELECT * FROM $table WHERE $table.geom && ST_MakeEnvelope($test, 4326) where $...
1
vote
1answer
66 views

Toggling leaflet controls ON and OFF?

I want to toggle the Leaflet layer control when the user clicks in a button. var layerControl = L.control.layers( { '<i class="fas fa-map-marked"></i>': OSM, '<i class="fas ...
2
votes
1answer
15 views

Unable to pull a bts.dot.gov MapLayer using Leaflet in R

I'm trying to get the noise pollution layer from the following bts.dot.gov ESRI MapServer to render in R: https://maps.bts.dot.gov/services/rest/services/Noise/CONUS_road_and_aviation_noise/MapServer ...
1
vote
1answer
153 views

Icon inside the 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
57 views

Geting fitBounds and removeLayers to work in Leaflet

I am making a Leaflet map that gets its marker and popup information from a database. I have a dropdown that allows me to retrieve a subset of the entire database based on category. The drop-down and ...
0
votes
1answer
50 views

Adding popup to Leaflet but only on click?

As there a way to add a popup to a marker but only show it when it is clicked? As it seems to be default to show it when one is loaded. This is no good when markers are getting updated. Currently ...
0
votes
0answers
43 views

Leaflet resetStyle only works for default style

I have a geojson layer. I set the style of some features based on property values. It displays correctly. When "highlight" on a mouseover it changes style to highlight correctly, when I mouseout it ...
0
votes
0answers
30 views

How to keep Leaflet polygon labels visible?

I would like to see the polygon label always as well if I zoom in. This is the starting point. now, when I zoom in I want the lables still to be visible, but they are not. My current code is: var ...
3
votes
1answer
212 views

Why hybrid GIS application gets GPS position only from Google & not from the device

I have built a GIS application using Leaflet on the web, after I put this web application to run on Android as a hybrid GIS application I made the application work with offline basemap (offline usage ...
1
vote
0answers
46 views

Extend / override Mapbox-gl 'baselayer' loadTile

Similar to how Leaflet's guide shows how to override L.TileLayer's getTileUrl method in place of your own (and L.GridLayer's createTile method), I want to know how to extend/override Mapbox-gl's ...
11
votes
5answers
1k views

Calculating correct longitude when it's over |180|?

I'm trying to develop a "formula" to correct the lat-lng values. I'm using vue-leaflet but when you pan outside the "first" world you get big numbers. Over +180 or under -180. For example: when I ...
0
votes
1answer
62 views

Hide null value attributes in Leaflet popup

I have marker properties which are fetched from the database and displayed as a table. I want to hide the "reply" feature property when it's null and display it only when there is a text entry against ...
0
votes
2answers
373 views

Ipyleaflet map object doesn't display in Jupyter Notebook but it gets created

When running the code from the example (https://ipyleaflet.readthedocs.io/en/latest/api_reference/map.html#example), no map get displayed. from ipyleaflet import Map, basemaps, basemap_to_tiles m = ...