Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
20 views

Highlight all GeoJSON multipoints of the same feature with a click in Leaflet

update: I've got most of what I want working… clicking on a marker changes its icon and also opens a popup showing that marker's properties (from GeoJSON feature.properties). Clicking on the basemap ...
0
votes
0answers
22 views

How to GeoJSON-encode a feature with many points where some properties of the member points are different

I have a db table with features like so fid lng lat color 1 14.5041 46.0434 blue 1 14.5367 45.8631 red 2 15.5041 44.0434 mauve 2 15.5367 43.8631 pink I want to convert the above into GeoJSON. My ...
0
votes
1answer
15 views

Load markers from a URL and update as user pans in Leaflet?

I have a webapp generating thousands of CircleMarkers on a map, and right now I just download a few MB of JSON from my server and instantiate them when the site loads. This is a lot of data to ...
1
vote
0answers
33 views

Leaflet - update content of a property in popup on a polygon click event

I work with Leaflet.js v 1.7.1 and have stuck with a problem of updating popup content data of data The data set is on a local disk Currently I have a local set of data: var data =[ { type: &...
1
vote
1answer
35 views

Using L.Control.Opacity plugin with GeoJSON layer in Leaflet

I have a fully working map with a few base layers and some buttons, each of which loads and displays different resources. One loads some historical map overlays and uses the L.Control.Opacity plugin ...
1
vote
0answers
25 views

Using SVG map as basemap and interactive GeoJSON on top with Leaflet/OpenLayers?

I have SVG map and GeoJSON file with cells. I need to combine them so the user can hover/click on cell and get some cell info like cellID in the console. Currently using the angular-leaflet-directive ...
0
votes
0answers
14 views

Google autocomplete using leaflet-control-geocoder?

I'm using leaflet-control-geocoder to search places in my leaflet map using google geocoder service, I have this //search box let marker; let googleGeoCoderProvider = L.Control.Geocoder.google({ ...
1
vote
1answer
28 views

GeoDjango rendering duplicate geometry in Leaflet

I have a GeoDjango app following this tutorial but substituting World Borders polygon data as included in the standard GeoDjango tutorial. I have created serializers and a django rest api that ...
0
votes
0answers
25 views

Incorrect tile loading with MapProxy

I am trying to publish my WMS map that I created from GeoServer with Leaflet using MapProxy. But what could be wrong with the MapProxy and Leaflet are not the same? services: demo: tms: ...
0
votes
0answers
28 views

Is a multiply nested GeoJSON still valid GeoJSON and can it be displayed by LeafLet.js?

Is this a valid GeoJSON? Can it be displayed using LeafLet GeoJSON Layer? "geometry": { "coordinates": [{ "coordinates": [{ "type": &...
1
vote
1answer
19 views

Unable to successfully bind an async function to a Leaflet marker popup

I want to create a marker popup filled with content from an AJAX call but I get an error Uncaught TypeError: Node.appendChild: Argument 1 does not implement interface Node.. Here is my code const foo =...
0
votes
1answer
77 views

Hide Wikipedia plugin layer below certain zoom level in Leaflet

How can I turn the following code into a variable, so that I can choose, or not, to load it in the layer control? and not anymore on moving the map or reaching this zoom level. I added a var wikilayer ...
2
votes
1answer
48 views

Turn display of marker tooltips on/off in layer control in Leaflet

I want to add tooltip which will show magnitude for each earthquake epicenter and was able to make it but I have a problem that with many epicenters in one area tooltips are overlapped. My question is ...
2
votes
1answer
19 views

Unable to remove marker cluster group completely from the map in Leaflet

I am having a weird issue with removing a MarkerClusterGroup layer from the map. When at a zoom level more than 5, I want to show markers on the map in a MarkerClusterGroup layer. When zoomed to less ...
1
vote
1answer
52 views

Search possibility to display filtered data with Leaflet.VectorGrid

I use Leaflet and Vectorgrid and I can display markers on the map. I have a geojson file of around 42 000 markers of places in Morocco and I would like to filter it to display only markers with a ...
1
vote
1answer
27 views

Getting coordinates after address has been picked in Leaflet geosearch control?

I'm using leaflet to make a web map with an address search bar. For that I'm using leaflet-geosearch plugin I need to retrieve the result once the user has picked the correct address from the search ...
1
vote
0answers
23 views

Leaflet highlight GeoJSON points within the other highlighted GeoJSON layer

I would like to have all the points highlighted within the other highlighted GeoJSON polygon. Next, I would like to have them displayed in the panel next to or at least in the console (for now). The ...
2
votes
1answer
46 views

View vector GeoServer line layer in Leaflet

I have simple line layer created based on shapefiles. It can be viewed in GeoServer with OpenLayers preview: I also can be imported and correctly viewed in QGIS. I tried to visualize this layer over ...
2
votes
0answers
22 views

Use Mollweide projection in Leaflet, for a Geoserver WMS layer

I did a world map in Geoserver, showing in Leaflet in the default projection, which is EPSG:900913 (aka GOOGLE Mercator) but I would like to use the Mollweide projection instead. I successfully added ...
1
vote
1answer
24 views

Getting attributes of polygons that line overlaps using Leaflet and Turf

I have a Leaflet Polyline: var polyline = L.Polyline(polylineData).addTo(map); and a Leaflet GeoJSON of Polygons: var countries = L.geoJson(countries, {style:{color:'darkgrey', opacity:1,fillColor:'...
0
votes
1answer
38 views

Add/remove radius circle after fitting map to radius with Mapbox

I am trying to add a range slider to zoom in and out of a Mapbox map to a radius in miles. I have the map and the slider working and I can sort of zoom in and out of the map by getting the bounds of ...
1
vote
0answers
44 views

Setting map view with 50 miles of radius of marker with mapbox

I have a mapbox map with a marker and I want to add a radius around it, say 10 miles. Now I can add a circle to the map, even though I do not want to, but I cannot get it to fit the screen. I have ...
0
votes
0answers
34 views

Visualize Hyperspectral data on Leaflet.js [closed]

I need to create a visualization of the hyperspectral data on a webpage. So I need the user to select any 3 bands out of 150+ spectral bands out of the data and display the tiled false-color image on ...
2
votes
0answers
38 views

Hatch polygons in Leaflet

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this: //Style of each polygon function style(feature){ return { opacity : 1, color: 'black', ...
1
vote
1answer
23 views

Remove link to leafletjs.com in attribution control in Leaflet

I will use the leaflet for a display showing a historical map of the history museum. It works on a local network that is not connected to the Internet, and visitors can manipulate the map with a ...
0
votes
1answer
40 views

Passing Google API key to Leaflet Control Geocoder? [closed]

I'm using Leaflet Control Geocoder to implement Google search, I am trying to pass my API key from Google Geocoder let googleGeoCoderProvider = L.Control.Geocoder.google('MYGOOGLEAPIKEY'); ...
1
vote
1answer
31 views

Leaflet Flickr photos and Marker cluster small image broken relation

I intend to use Jose Mamira's Flickr plugin to show clustered photos from Flickr, with their thumbnail (first all photos, for this exemple, then I would easily change the code to display only my own ...
0
votes
1answer
25 views

WMS layer not visible while clicking Leaflet's grouped basemap layers

I have a webpage that adds Geoserver's WMS layer to the OSM basemap and also provide GetFeatureInfo on map click. The webpage works fine. The code was adapted from here. For the sake of tidiness, I am ...
0
votes
2answers
59 views

Leaflet : two or more WFS overlay layers?

I'm happy this script helped me to get a WFS layer inside Leaflet. I just had to use a trick of Geoserver (set ENABLE_JSONP to true in the Geoserver relevant config file). WFS and Geojson layers in ...
3
votes
1answer
74 views

Leaflet Wikipedia layer

I'm trying to use the Wikipedia layer in english: http://mappingforyou.eu/javascript/Leaflet.Wikipedia.js but I'm not successful on using the leaflet infotips "BindPopup". The code could be ...
1
vote
1answer
45 views

Clone one marker into multiple categories in Leaflet

I use L.control for select layers. I want posted one point in different layer, like here http://www.gistechsolutions.com/leaflet/DEMO/sports/index2.html But here, different point from different ...
0
votes
1answer
30 views

Change point marker in GeoJSON layer in Leaflet

I successfully loaded a WFS in Leaflet, with https://cdn.rawgit.com/heigeo/leaflet.wms/gh-pages/dist/leaflet.wms.js if I recall; var start_at_zoom = 10; function onEachFeature(feature, layer) { //...
0
votes
0answers
62 views

React leaflet marker cluster using dynamic GeoJSON

I try to use react-leaflet-cluster inside my project. I want to display GeoJSON which contains some polygons and points. The only way it works is by passing static data to GeoJSON component like this: ...
2
votes
1answer
60 views

Leaflet mouseover event with two markers

I have a map on which one layer overlays the other one (I have icon markers displayed and larger circles markers behind them). I'm trying to create a function that changes the icon symbol AND the ...
1
vote
1answer
50 views

Leaflet popups usually open and immediately close when using mobile/touchscreen device

I've been building a wiki for golf courses, and I'm now trying to add a map to the homepage. Everything seems to work just fine, unless it's on a touch screen, where, most of the time, but not always, ...
0
votes
0answers
38 views

Attribution control not showing in Leaflet

I can't add the attribution control for the life of me. This is my 4th time using Leaflet in a webapp and the first time I have this issue. var map = L.map('map').setView([55.861098, -4.255484], 14); ...
1
vote
1answer
45 views

Change marker icon on mouseover/mouseout in Leaflet

I have a map made with Javascript, on which there are numerous points and each one of them has a specific png marker. I managed to display all the markers correctly with the following code: var ...
0
votes
0answers
19 views

Duplicated labeling when QGIS server serves WMTS [duplicate]

For a roleplay project based in the Star Wars Universe I am currently mapping the Star Wars Galaxy in QGIS using a custom projection. At the end I want to serve the map as a basic WM(T)S output. Thus, ...
0
votes
1answer
42 views

Serving polylines as raster tiles

I have a (big) list of polylines that I would like to serve as raster tiles to be consumed by Leaflet in a format such as https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png. The tiles will only be ...
0
votes
1answer
48 views

Find the map variable

I have a filterable map on my Wordpress site which I've made with the LocateandFilter plugin on Wordpress that uses a Leaflet map with a Google Maps overlay. I want the map to zoom on on the state ...
0
votes
2answers
41 views

Leaflet marker not added to the map after click event on div element

I am trying to add a marker after performing a search, at a specific location given latitude and longitude. For some reason, the browser runs the code but does not add the marker to the map. //...
1
vote
0answers
52 views

Show marker moving live along an ipyleaflet map?

I'm trying to simulate the real-time movement of a vehicle along a pre-determined path (as a list of coordinates) on ipyleaflet (running on a Jupyter Notebook). What I've tried is to instantiate a ...
0
votes
0answers
27 views

Leaflet map popup bound to polygons showing geodesicArea only shows area of most recently drawn polygon

I have a leaflet map with popups bound to polygons. On clicking the polygons the pop up only shows the area of the most recently drawn polygon. I thought this was because of the use of 'draw:created' ...
0
votes
1answer
40 views

Make a featureGroup with a layerGroup that is also editable in Leaflet?

I have a Leaflet map with a featureGroup, a layerGroup and drawControl however only the featureGroup is editable using the drawControl. I think its because the layerGroup is separate from the ...
1
vote
2answers
42 views

Variable substitution with environment variables in SLD and GeoServer

I'm posting this as a new question as a follow-up to this one Geoserver SLD: Dynamic Variable Substitution I am struggling to get SLD variable substitution to work where I have an environment variable ...
0
votes
0answers
12 views

Cluster points in GeoDjango using Leaflet

Am trying to cluster point in Leaflet from the data created in backend geodjango.I have converted to geojson format to be able to visualize. #views.py def data(request): data=serialize('geojson',...
1
vote
1answer
48 views

Using WFS and Leaflet

I'm quite new to Leaflet, and i would like to use this WFS, https://wxs.ign.fr/agriculture/geoportail/wfs?SERVICE=WFS&REQUEST=GetCapabilities, to display interactive agricultural plots on a ...
0
votes
1answer
26 views

How to display all the column values of overlapping polygons in leaflet popup with R?

I have intersected points data with a grid in which I would like to display the name of all the species found in every cell. Code sample: library(dplyr) library(rgdal) library(leaflet) library(sf) ...
0
votes
1answer
52 views

Adding WMS (IGN) to Leaflet

I'm using Leaflet to display agricultural plots obtain from a WMS. Here is the link to the WMS : https://wxs.ign.fr/agriculture/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=...
1
vote
1answer
47 views

Dynamically change Leaflet PopUp Background on updating PopUp content

I have a function that sets new content to the Popup and opens it whenever the function receives data from the socket. layer[i].getPopup().setContent(content) layer[i].getPopup().options.autoClose = ...

1
2 3 4 5
75