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

0
votes
1answer
56 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
36 views

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

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 ...
0
votes
0answers
18 views

Is there any way to disable panning but get drag event on map

If I disable dragging on the map, panning is disabled and that is excellent. But I still would like to have the drag event triggered, but as far as I can see this does not happen. Mousemove works fine,...
0
votes
0answers
15 views

GeoDjango show only one map of all geofields

I've got this model: location = models.PointField( verbose_name=_("Location"), help_text=_("Standar location"), srid=4326, blank=True, null=True ) area_poly = models....
0
votes
0answers
16 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
2answers
122 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 ...
0
votes
0answers
18 views

Determine if markers are inside of the circles array?

I have a problem in determining if markers are inside of the circle array or not. The code that I have provided manages to know the markers only for one to two circles while the rest does not know. ...
1
vote
0answers
57 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
18 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
28 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
0answers
25 views

Reorder WMS Layers Using an Interface on Leaflet/Openlayers

As simple as it sounds, WMS layers from Geoserver rendered on client side via Leaflet/Openlayers have their Z-index predefined in the code itself; I was hoping to use an interface of sorts to reorder ...
0
votes
1answer
39 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

Webmap plugin in QGIS 2.18

I am having big trouble using the 'Webmap' plugin. It worked very beautifully until something happened with the encoding of characters. As of now QGIS just hangs up. This is the error message I get ...
0
votes
0answers
21 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
15 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
21 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
41 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
27 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
12 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 ...
0
votes
0answers
19 views

How do I call point marker icons from geojson data in leaflet

I am trying to make a map for school with unique icons for each point which I have stored in my geoJSON under "iconURL" as .png. I don't exactly know how to add them to my map. The following code ...
1
vote
1answer
37 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
46 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
23 views

Add a popup to leaflet but only on click

is 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
16 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
19 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
188 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 ...
0
votes
0answers
25 views

Dynamic Gallery in a Popup on React Leaflet

I am developing a Reactjs app with react-leaflet and I am trying to inject the images which I am taking their path from a promise, but the main error that I am taking is the following Uncaught ...
0
votes
0answers
21 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
30 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
0answers
98 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 = ...
1
vote
0answers
39 views

Adding a position.watch and update feature to live map with leaflet.js?

I have an app working in node.js that locates a user and plots their location on a leaflet map. When others connect it shows them too. It keeps their marker live as long as they move the mouse. I ...
0
votes
0answers
22 views

Leaflet routing machine - get route JSON response

I created a simple page based on Leaflet routing machine tutorial. I would like to process obtained route with my API. How could I to get full JSON response with route?
0
votes
0answers
25 views

Leaflet.js geoJSON popup stopped working?

I have been developing a map that consumes geojson data and places markers on a map and creates popups. I have had this functionality working, but recently it has stopped working - I get the error "...
0
votes
0answers
98 views

Making Leaflet map or satellite view like Google Maps using JavaScript?

I'm looking for a solution to create a box to switch between map / satellite layers, like Google Maps has. Could someone help in creating this switch style like Google Maps? What I have using Leaflet ...
1
vote
0answers
19 views

Leaflet Marker Cluster and Labels white hallow

As you can see on my map. I have Clustered Markers and Individuals markers with some kind of white hallow around that I want to remove. This is my CSS file for the style .marker-cluster { ...
1
vote
0answers
27 views

Legend for OpenTopoMap in Leaflet

I want to use OpenTopoMap as background map in Leaflet. I can't find information about the colour encoding of heights to create a legend. Does anyone know the correspondence between colours and ...
1
vote
0answers
19 views

How to add leaflet-measure-path addon to Leaflet.Editable? [closed]

I want to see a measures, generated by leaflet-measure-path on polylines, dynamically created via Leaflet.Editable 's control. How do I do it most correctly?
0
votes
0answers
28 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 ...
3
votes
1answer
75 views

Problems using a “custom” projection with Leaflet

I'm currently trying to display a dataset on a webapp using Leaflet. All the dataset is projected into French projection Lambert II ESPG 27572. Instead of converting coordinates, I'm trying to setup ...
0
votes
1answer
77 views

L.control.layers: Uncaught TypeError: Cannot read property 'minZoom' of undefined

I am trying to add my geojson urls which I loaded from my gist as L.LayerGroup for L.control.layers but I have encountered error "Uncaught TypeError: Cannot read property 'minZoom' of undefined" on L....
1
vote
1answer
39 views

Leaflet geojson merge attributes

I need to merge the attributes on a leaflet geojson layer and another geojson based on a common field. I have tried the following code, which does put the keys in the layer but all values are ...
1
vote
1answer
36 views

Leaflet.Geodesic.js line not drawn

I am trying to use Leaflet.Geodesic.js geodesic to draw a geodesic line between two points, but I don't see any line at all. Based on the Leaflet.Geodesic.js example script, this is what I have tried....
0
votes
1answer
34 views

Change separator of attributions in Leaflet?

Is there a way to change the comma shown in the image below to | I used the QGIS plugin QGIS2WEb to create the Leaflet map and wanted to link to the source of the information. Currently, in the HTML ...
1
vote
0answers
12 views

Leaflet Summary widget

Is there a way to display Summary of numeric attributes from a layer in the visible map extent, like ArcGIS Summary widget ?
0
votes
1answer
25 views

Function for Labelling Icons per category in Leaflet

I have geographic coordinates that I display to a Leaflet Map. Each feature is ether in the Category (2018, Never Covered or Other periods). I would like to create a simple function to have ...
1
vote
1answer
67 views

How to use Planet Lab tiles in Jupyter Notebook?

I just want to use Planet tiles as a basemap for a Jupyter Notebook application, using ipyleaflet widget. In my environment, I imported these packages: from ipyleaflet import Map, basemaps, ...
1
vote
1answer
74 views

Getting elevation data in Leaflet [duplicate]

I'm using Leaflet map + GeoServer to display a map. I have a TIFF file and a DTED level 2 file. I created a GeoTIFF store and layer that i'm showing in Leaflet, And I created a DTED store and layer ...
3
votes
1answer
81 views

Leaflet invalidate size - is not a function (undefined)

I have a leaflet map that is nested within a div. I have tabs. When the tab that contains the leaflet map is the default tab, the map loads and works correctly. When it is not, it does not load ...
0
votes
0answers
29 views

Interactive legend choropleth map

I am working on a choropleth map, I would like to build an interactive legend, so when mouse down the legend the correspondent objetcs on the map would turn on. Any suggestions? <head> <...