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
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [leaflet]

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

0
votes
0answers
15 views

Highlighting feature in qgis2web leaflet when using search field? [on hold]

I am looking to highlight features (in my case a path - polygon) when searching for something in qgis2web (in leaflet it only pops up as a circle) this is possible in an openlayers map by default in ...
0
votes
2answers
22 views

Find closest point using L.GeometryUtil.closest and open its popup

How do I use: L.GeometryUtil.closest(myMap, coords, b) to find the closest point in a geojson point layer in leaflet. I have tried several things. And the error I receive is: Uncaught TypeError: ...
0
votes
1answer
25 views

Variable iconUrl in Leaflet, use GEOJson property voor iconUrl definition (Leaflet)

My script is as follows: function clickFeature(e, feature) { var layer = e.target; var string = new feature.properties.categorie; var bigIcon = new BigIcon({iconSize: [24, 40], iconUrl: +string+...
2
votes
2answers
53 views

Loading WFS data using Leaflet?

I have hosted a Geoserver image in a docker container locally and I created a layer using some sample data stored in a Postgis database. I think the layer is correct, because when I click on layer ...
4
votes
1answer
38 views

What are possible values of iconSize in Leaflet Marker Icon Options?

I have a very standard script: var redIcon = L.icon({ iconUrl: '1.png', iconSize: [10, 10], // size of the icon iconAnchor: [5, 5], // point of the icon which will correspond ...
0
votes
0answers
17 views

Load GeoJSON generate from MySQL with PHP [on hold]

I need help with creating the code in the Leaflet to load GeoJSON using the PHP script. I tested the echo from PHP at http://geojsonlint.com/ and GeoJSON is showing it correctly has a good structure.
0
votes
0answers
26 views

Trying to figure out ArcGIS API's `mapScale` variable and how it maps to OpenStreetMap's zoom level

I'm using ArcGIS' /export endpoint to get an .svg of a few map layers given a specific bounding box. However, when I apply the .svg as an image overlay to OpenStreetMap's world map using Leaflet, the ...
1
vote
1answer
27 views

Leaflet: improve code for show/hide legend icon

I'd like to know how I can improve the code below, making it better and easier to read. The idea is that when the user turns on / off the layer, their representation in the legend is also shown / ...
1
vote
2answers
40 views

Leaflet - How to show feature properties in a box that is not a popup?

Popup giving features properties are interesting but I would like to make a side bar where properties of a clicked feature would show. I've got the traditional code for displaying geojson features ...
-1
votes
0answers
24 views

Graphing and coloring parts of map with precipitation data and include legend?

I need to graph rain data from OpenWeatherMap. I also need to shade in a red color with an opacity of 0.3, on top of the prcipitation layer. This is the code I have, but it gives me an error, that ...
1
vote
2answers
48 views

How can I overlay an image (exported via ArcGIS API) on an OpenStreetMap map?

Before I attempt to explain my situation, I'd like to disclose I'm very new to these apps and GIS in general. There's a public ArgGIS server that I'd like to export a layer from and overlay on an ...
0
votes
1answer
31 views

Z-index isn't working for L.tileLayer

I am having difficulty with layer order. I have 4 layers but zIndex is not working for L.tileLayer. Here's a part of my code: https://pastecode.xyz/view/d726ccb1 var overlay_Numerydziaek1 = L....
1
vote
0answers
31 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
25 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. ...
-1
votes
0answers
30 views

Filtering geojson and giving custom marker for same data using Leaflet? [closed]

My script returns a value of a geojson dataset to a popup, from which the markers I filtered using an attribute in my dataset. For some reason I can not get the markers custom (and when it works all ...
0
votes
1answer
31 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
37 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
82 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
37 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
68 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-...
0
votes
2answers
31 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
21 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
36 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 ...
0
votes
1answer
67 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
63 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
47 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
23 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
60 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
35 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
43 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', ...
0
votes
1answer
31 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
41 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
30 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
24 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
58 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
35 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
76 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
42 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
76 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
36 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
100 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
43 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 ...
-1
votes
0answers
41 views

Toggling choropleths and tooltips with Leaflet.js

I've a map showcasing two choropleths, as well as three separate polygons (two of which are related thematically). My objective is to create a functioning toggling tool to 1) select one choropleth at ...
2
votes
3answers
243 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
74 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
22 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
37 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
54 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
32 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
39 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 ...