Questions tagged [leaflet]

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

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

Leaflet info box only showing properties from selected layer

I would like to use the info box as shown in the tutorial interactive choropleth map with multiple layers and properties from different layers. The idea is to only show the properties from the ...
0
votes
1answer
37 views

How to Use ST_MakeLine query in leaflet to connect to Carto

I want to run in leaflet a query that works in carto Builder to connect points in a line: SELECT ST_MakeLine(the_geom_webmercator) as the_geom_webmercator, min(cartodb_id) as cartodb_id FROM my_table ...
0
votes
1answer
67 views

Issue with using MultiLineString in Leaflet Animated Marker Plugin

This response on image below is coming from Geoserver as MultiLineString and I restructured it to LineString like on image because Animation plugin doesn`t support MultiPolyline json structure and ...
0
votes
2answers
223 views

Zoom to points using d3SvgOverlay

I have an application where a csv file is filtered and the filtered data is displayed on a leaflet map. What I would like to happen is for the map to zoom in to the points. I have tried using ...
1
vote
1answer
555 views

Showing all features by real-time API with Leaflet Map

I want to show all URL parameters or features onto a map. I have made the variable with ajax query as well as inside the loop data is printing with variable but I want to show this data with map into ...
0
votes
0answers
18 views

Django-leaflet: How to display geojson from database to django-leaflet

I am trying to map points from database on django-leaflet map using django-geojson package. I am able to access the data as url, but I am not able to display the points. I am baffled what could have ...
1
vote
1answer
914 views

Leaflet polyline not working

I'm trying to draw polyline to connect an array of waypoints. But I'm getting an empty div like this instead of a map with route. My code is this: <script> // set center ...
2
votes
1answer
535 views

Rendering OpenStreetMaps with GeoServer

My target is to have the whole planet to be available in the map client[leaflet.js/openlayers.js] but only a specific country loaded with roads etc. I have followed the steps below to setup my ...
0
votes
1answer
266 views

GeoDjango raster field display on Leaflet

In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo. here the code : settings.py postgis ...
0
votes
1answer
330 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 ...
1
vote
1answer
76 views

Dividing GeoJSON into two separate layers in Leaflet

Basing on this example: http://www.gistechsolutions.com/leaflet/DEMO/sports/sports.html I would like to do the same in my case, however, my way is slightly different: Firstly I have made a major ...
0
votes
1answer
207 views

How to read a WFS published through QGIS server with Leaflet

I would like to read a WFS published using QGIS server, with the plugin Leaflet-WFST but an error occurs when the plugin is trying to read the geometry. Error : uncaught exception: unknown child ...
1
vote
1answer
383 views

Search box for GeoJSON in Leaflet

I have been struggling with adding a search box for GeoJSON stuff, similar to COntrol.geocoder in Leaflet. I used the advice under this post: Adding one search box for multiple GeoJSON polygon layers?...
1
vote
1answer
768 views

Leaflet-Search plugin error

I try to connect Leaflet search plugin to my map with GeoJSON data. But when I enter a search query in browser inspector I get error: layer.getBounds is not a function in leaflet-search.js. You can ...
1
vote
1answer
26 views

Leaflet (React-Leaflet) custom renderer

I am reposting a question that i asked in stackoverflow about leaflet and custom renderers. Basically what i want to achieve is create a custom renderer that alters the shape of CircleMarker or ...
1
vote
1answer
191 views

Leaflet filter with multiple GeoJSON layer properties

Regarding to the following queries https://stackoverflow.com/questions/59141456/leaflet-problem-with-filtering-the-geojson-layers GeoJSON filtering based on properties in Leaflet not working I ...
1
vote
1answer
170 views

Turn Layer off by default in Leaflet LayerControl

In the following python code I have three data layers while I need to show only two of them by default as the program executes. So the Places and District layer should be checked as the map is opened ...
0
votes
1answer
61 views

L.Control.Search for filtered marker with multiple layer

I have two geojson layer. tram.js and ubahn.js, both with just marker, I use them in a filter and want to search for these filtered marker. But it isn't working and I don't get any errors. I used ...
0
votes
1answer
46 views

Leaflet Map Exported Using Export Web Map Task Looks Stretched

I'm running an Angular application that displays a map using Leaflet, and has a custom print where the user can set some options before sending a request to the ArcGIS Online print service (https://...
1
vote
1answer
501 views

Preventing map panning to last drawn marker using Leaflet?

I have a basic Leaflet map where I need to draw several markers and lines on. How do I prevent the map from panning to the last drawn object? I've read about setting autopan : False for popups from ...
2
votes
1answer
59 views

ST_AsMVT vector tiles distort at low zoom levels

I'm serving up a data from PostGIS by converting it into a tile and then bytes and then onto a leaflet map. It all works, with one exception, the latitudes stretch ever greater towards the poles when ...
3
votes
2answers
272 views

Hiding leaflet tooltip on mobile device?

I would only display a tooltip on a device without a touchscreen. A popup and a tooltip will be displayed on your mobile by clicking on the point. I would like to see only popup var ubytovaci = L....
2
votes
3answers
73 views

Add something into L.CircleMarker

I have two different colored CircleMarkers for two geojson layer. Is it possible to add a letter into those circles, without using divIcon? This is where I give them the color. function getColor(...
4
votes
3answers
15k views

Calculating bounding box of given set of coordinates from Leaflet Draw?

I have values generated from Leaflet Draw plugin that look like this: { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [ [-73....
0
votes
1answer
91 views

Leaflet markers at same position: dynamically display all markers infos through one marker only

I created a map using Leaflet, with a filtering system, custom icons with the leaflet.awesome-markers plugin, and jquery functions so that when you click on the markers, the corresponding information, ...
1
vote
0answers
13 views

Approach to smoothly transitioning a large amount of GeoJSON features' style

I'm working on an interactive Leaflet map with about 1000 GeoJSON features. When I click on a one of the menu items on right, I use a function to style the feature according the values of the active ...
0
votes
1answer
206 views

Filter getInfo request

Following this example and according to Leaflet WMS documentation I extended L.WMS.Source class and overwrote hooks (e.g. showFeatureInfo). My example can be found here. When I use the code as ...
0
votes
1answer
44 views

Map slightly off-center with simple (cartesian) CRS and tilelayer in Leaflet

After several attempts, some tinkering and a lot of asking here, I got my fictional map running with tiles by setting up a simple custom CRS. Alas, the map is slightly off center. I got the feelig ...
0
votes
0answers
61 views

WMS with EPSG:3004 not returning tiles in LeafletJS

I am consuming an Italian WMS in a CRS with an EPSG code of 3004 in QGIS. It works somehow (Needed to change the CRS from 4326 to 3004), yet the definition in the GetCapabilities document is strange (...
0
votes
1answer
36 views

Setting polygon style with setStyle() function in Leaflet does not work from select menu

I think this question will be easy for you But I don't know where is the problem I am trying to change the style of the rectangle using the select menu but it does not happen In contrast, when ...
0
votes
0answers
47 views

Leaflet - do I need the rastercoords plugin for an non-geographical map with CRS.Simple and local tiles?

I got a fictional map set up following this tutorial: https://leafletjs.com/examples/crs-simple/crs-simple.html But when I try to switch the imageOverlay for map tiles (generated with gdal2tiles-...
7
votes
4answers
5k views

Which style options are available for polylines in Leaflet?

I added a polyline layer as GeoJSON within Leaflet and want to style it. The following options to set the style I could find (and which work) are: color weight opacity What are other available ...
0
votes
2answers
75 views

Generate own XYZ Tile (MBTiles) - which URL?

I want to create my own xyz tile for an own basemap on my webspace. I want to use the own basemap for a qgis2web leaflet map. This I have done: processing toolbox: generate XYZ tiles (MBTiles) I get ...
0
votes
1answer
145 views

Web Application using Leaflet

I'm trying to make a web application mainly with Leaflet. This is my code. I can download a file, but when you first open this web application, no layers are shown on the map. However, once I loaded ...
3
votes
2answers
853 views

Basic Authentication in Leaflet

I'm using Leaflet to display map tiles. The map tiles are loaded from a different site using basic authentication. So the url template looks like this: L.tileLayer('https://username:password@example....
0
votes
0answers
26 views

Reading GeoJSON from external file in Leaflet [duplicate]

I found the following script on the web but I don't know how to change the way to read JSON code. In the script the JSON code is included in a var called sitec but I need to read that code from an ...
0
votes
0answers
22 views

Open the popups of all markers that are visible on the map with a zoom > 14 [duplicate]

I need to open all the markers that are visible on the map at Zoom > 14. I am using leaflet.CircleMarker Init map var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { ...
0
votes
1answer
51 views

Avoid duplicate properties from GeoJSON file in a Leaflet map

I'm posting this question here because it is related to GeoJSON and Leaflet. Here are my requirements : My map is ready and functional. I'm using markerCluster to create clusters when several ...
0
votes
2answers
160 views

Leaflet GeoJSON popup marker customization

I would like to customize leaflet .bindPoPup geoJSON marker. I found some solutions, although I would like to use my existing one. Basically the operation leads to merge two functions as per below: ...
1
vote
1answer
23 views

How to set the same size between GeoServer and Leaflet?

The right Map is a layer from GeoServer (I set the CRS as 4326) in the left is the result of the Leaflet code (here a linked the GeoServer layer to publish in the leaflet map), as you can see in the ...
0
votes
0answers
10 views

Leaflet layer box to appear larger

I want the layer containing box at the top right in a leaflet map to appear larger. When I open the map in mobile the layers panel appear smaller to read out. Is there a way to enlarge the layer box ...
1
vote
1answer
20 views

Adding a value to L.imageOverlay

I'm trying to add a value to an L.imageOverlay in leaflet. When you add the layer on the layer control panel, it adds the value using the function below to the total, I've tried it with an attribution,...
0
votes
0answers
15 views

How to include a Mapbox Studio Tileset in Leaflet?

I would like to include in my Leaflet map a vector tile set that I uploaded to Mapbox Studio. I first uploaded a tileset to the tiles page of Mapbox studio. Then I created a new style and added my ...
0
votes
1answer
39 views

Leaflet - global variable in onEachFeature returns value of next feature

Thanks to TomazicM I got my GeoJSON import up and running. Here's the whole code, I highlight the problematic bits thereafter var map = L.map('map', { crs: L.CRS.Simple, minZoom: -...
1
vote
1answer
106 views

Get L.marker individual attributes

I am using this code to draw points on the map: coordsArray.push(lat); coordsArray.push(lng); marker = L.marker(coordsArray, { icon: myIcon, clickable: true, draggable: 'false', title:...
0
votes
1answer
2k views

Unable to dynamically locate map boundary coordinates in OSM/Leaflet

I have been trying for the past hour to take the coordinates of the map edge in a OSM/leaflet application I am making. While I can get the coordinates of the center, and I can get the coordinates of ...
9
votes
2answers
15k views

Make Leaflet map background transparent

How can I make the background of the Leaflet map transparent. I see opacity controls from the layers, but not the map background. Should the be changed just with plain CSS?
0
votes
0answers
13 views

How to set map background color in Leaflet [duplicate]

When I display a map in Leaflet, the background color is gray. I would like to be able to change it. How do I change it?
0
votes
1answer
45 views

Cannot add Leaflet markers to map iterating through CSV

I have data from a CSV that I want to turn into markers using the latest version of LeafletJS. I can successfully turn the CSV into an array of js objects and have confirmed that the latlng ...
1
vote
1answer
718 views

Embedding static Google Earth Engine JavaScript in web page?

I have made a couple informational views in Google Earth Engine code editor and would like to put the resulting static map in a webpage. I am a novice at html, but have experience embedding mapbox ...

1
2
3 4 5
65