Skip to main content

Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

In Leaflet, using multiple Tile Layers, why do previous zoom level tiles persist on zooming?

I am using Leaflet with four raster tileLayers - an opaque base layer and three overlay layers with transparent backgrounds. If I use the base layer with any one of the overlays, everything works fine....
SGMaps's user avatar
  • 1
2 votes
1 answer
50 views

Initializing a map container only if it is not already initialized in Leaflet

I have a very specific "Map container is already initialized" problem different from other such questions I've found in my prior search. My web page has a lot of images. If the images have a ...
punkish's user avatar
  • 277
2 votes
0 answers
39 views

GeoJSON is null error in a Leaflet + D3.js

I am developing a web page with Leaflet and D3.js that draws the distribution density contours of a bird species (Ciconia ciconia) with data from the Global Biodiversity Information Facility (GBIF). I ...
Acperience's user avatar
  • 1,142
-1 votes
1 answer
80 views

Adding secured WMS layer to Leaflet JS [closed]

I am trying to add a paid WMS layer secured by username and password to my Leaflet project. Both, the Leaflet project and the WMS server are HTTPS encrypted. What would be a proper way to do IT? I've ...
MrSalamikuchen's user avatar
1 vote
0 answers
31 views

Leaflet Mini Map Not Displaying with Esri Basemaps [closed]

I am trying to add a mini map to my Leaflet map that uses Esri basemaps. However, the mini map is not displaying correctly. I have included the necessary libraries and followed the setup instructions, ...
Rony Golder's user avatar
1 vote
1 answer
45 views

Put added three.js object from external js module on top of base map in Leaflet

I have a leafelt map app where first I initialize and add a tile layer like so: <body> <div id="map"></div> <script src="https://unpkg.com/leaflet/dist/...
geo derek's user avatar
  • 529
1 vote
1 answer
48 views

Display GeoJSON file with added properties in Leaflet

I have a Geojson file and have successfully added new properties that comes from a CSV file. Unfortunately, I am not able to display the modified file in Leaflet. Any help is welcome! Here's my code: &...
RolfDD's user avatar
  • 13
0 votes
0 answers
28 views

Circle symbols are displayed incompletely in tiled WMS [duplicate]

I am setting up a MapServer WMS point layer which is symbolized as circles. When I query the layer as tiles (e.g. 256x256, using the Leaflet default), it seems that each tile only includes circles ...
Christa Rohrbach's user avatar
-1 votes
1 answer
60 views

Leaflet map in projected coordinate system

Is there a way to show the leaflet map in a custom projected coordinated system, such as the North America Albers Equal Area Conic_1? We can do this in D3.js, but can we do it in Leaflet.js? Something ...
Abdullah's user avatar
1 vote
1 answer
36 views

LeafletJS: Mouse click event on a LayerGroup not working

I added a click event to a LayerGroup. But it did not work. I am pasting code below: const map1 = L.map("map1", { center: [11.274, 50.765].reverse(), zoom: 10 }); const mlyr2 = ...
Arun's user avatar
  • 13
0 votes
0 answers
55 views

Why NOAA layers appear to be incorrect

I had previously built a Leaflet map that pulled past precipitation data (24, 48, and 72 hours) from the NOAA nowCOAST site, however, the site was decommissioned. I used a previous StackExchange post ...
geoscience123's user avatar
0 votes
1 answer
69 views

GeoServer non-tiled WMS with Leaflet

Are non-tiled WMS layers possible in GeoServer? I passed tiled:False option in Leaflet but I still get tiled layer. const prew = L.tileLayer.betterWms("http://localhost:8080/geoserver/wms", {...
user2727167's user avatar
0 votes
0 answers
37 views

Leaflet.js dragging is really slow in Firefox

I've made a Leaflet map for my clients using Django. The map is working great on Chromium based browsers (I've tried Google Chrome, Microsoft Edge and DuckDuckGo), but dragging around is insanely slow ...
pfrud's user avatar
  • 81
0 votes
1 answer
57 views

PDF connected to point feature published to Leaflet with QGIS2Web

I have a PDF connected to point feature in a desktop project in QGIS and activating the Action on the point opens the PDF perfectly. I tried publishing this with QGIS2Web. The PDF is moved to the ...
Mikeoramma's user avatar
1 vote
0 answers
55 views

Ipyleaflet map crashes Jupyter notebook and says out of memory

I wrote a code to show some points on ipyleaflet map that will be updated automatically. at first, the map shows fine, but despite removing markers after a certain time (eg. 72 hours) the notebook ...
Shane roar's user avatar
0 votes
1 answer
72 views

Leaflet markercluster: getting the zoom level at which a specific marker is no longer clustered?

I'm using Leaflet markercluster in an app. I have an endpoint where a specific marker is selected (eg. ../marker/12); so the maps centers on that marker and displays its popup when the page loads. But ...
gordie's user avatar
  • 274
0 votes
1 answer
94 views

Filter GeoJSON layer dynamically in Leaflet?

I try filter layer on my Leaflet jsonp from input text html to my JS code but is not working. On my code I tried to make filter is working only when I insert number 4 directly: let pontoFiltrado = ...
Quetions's user avatar
0 votes
1 answer
79 views

Load only low resolution of polygons in Leaflet

Leaflet uses the principle of loading map tiles according to the zoom level, that is, the resolution of the map image depends on the zoom level. Can we apply the same principle to a polygon? My ...
João Pimentel Ferreira's user avatar
2 votes
1 answer
114 views

Simple way to put a canvas on a map using Leaflet?

In Mapbox GL JS I might do something like: const canvas = document.createElement("canvas"); canvas.width = WIDTH; canvas.height = HEIGHT; map.addSource('canvas-source', { ...
John's user avatar
  • 141
0 votes
2 answers
85 views

How to offset labels in Leaflet using field-based rotation & offset?

I have a small dataset displayed as points in Leaflet. Each point has 3 arrows (right, left, head) coming out of it and they are rotated based on 3 separate fields (rhead, lhead, head). i want the ...
massivedaikon's user avatar
0 votes
1 answer
54 views

SVG arrows not behaving like the other arrows in Leaflet

I have a Leaflet web map displaying 13 points and 3 arrows diverging from each point (4 layers total). The map was exported from QGIS via QGIS2Web. I'm using placeRotatedSymbol() to place the arrow ...
massivedaikon's user avatar
1 vote
2 answers
48 views

Error when using CRS 32718 in Leaflet

I'm trying to specify the CRS 32718 with Proj4Leaflet to a Leaflet map but I'm getting an error: "ERROR TypeError: coordinates must be finite numbers" My code is following: var crs = new ...
Javier Aguilar's user avatar
0 votes
1 answer
53 views

Offset & anchor field-based arrow SVGs in Leaflet

I have a leaflet web map displaying 13 points and 3 arrows diverging from each point (4 layers total). The map was exported from QGIS via QGIS2Web. all layers (including points) have exactly the same ...
massivedaikon's user avatar
1 vote
1 answer
69 views

Converting geography x, y values from vector tiles data to lat long in Leaflet

I am using the following map for India (https://data.maptiler.com/downloads/tileset/osm/asia/india/) and serving it via a server to send pbf files. The map shape is rendering correctly, and I want to ...
KARTIK TIWARI's user avatar
0 votes
0 answers
35 views

Convert default coordinate system React-Leaflet

I'm trying to make a request from the NASA satellite, but when I use 3857 it doesn't show the region I want, and in 4326 it does. That's the problem, when I use 4326 it moves on the map and I can't ...
Felipe L's user avatar
0 votes
0 answers
88 views

How can a request be started with Leaflet Routing Machine with one waypoint?

If a round trip is compiled with the Leaflet Routing Machine and lrm-openroutservice, this is not fired as the Leaflet Routing Machine requires a start and an end point => two waypoint. ...
Severin's user avatar
1 vote
1 answer
77 views

Make Leaflet geocoder search marker open popup containing GeoJSON data

The following JSFiddle uses Leaflet and leaflet geocoder control search plugin. Code below HTML: <div id="map"></div> CSS: #map { height: 100%; position: ...
Discover's user avatar
2 votes
1 answer
95 views

River network WMS layer not showing in Leaflet map

I am trying to display a map of European river network on a Leaflet map, using as data source the EUHydro layer published by CLMS (here is the webpage, and the WMS GetCapabilities document). Here is ...
tvoirand's user avatar
  • 298
0 votes
1 answer
116 views

leaflet-simple-map-screenshoter cannot load custom tiles because of CORS error

If I try to make screenshots with my custom tiles, I am getting CORS errors. If I use mapbox or openstreet map tiles, I don't have any issues. I don't get any errors if custom tiles are used in ...
Matt's user avatar
  • 95
-1 votes
1 answer
57 views

Seeking Leaflet printing library that is flexible (not browser print)

I'm a junior developer and I've been tasked with updating the leaflet part of the website. Do you know a good printing library where I could just export the map shown on the screen and manipulate it a ...
François Poulin's user avatar
1 vote
1 answer
144 views

Offsetting rotated arrow SVG markers in Leaflet (exported with QGIS2Web)

I have a map exported from QGIS (3.34 Prizren) as leaflet via QGIS2Web plugin. The map has 3 layers (identical data) but 2 are displayed as arrow SVG markers and 1 is displayed as points. Left arrows ...
massivedaikon's user avatar
1 vote
0 answers
95 views

gdal2tiles-leaflet producing bad tiles

I am using gdal2tiles-leaflet in an attempt to generate a tileset for a map renderer I'm working on, however, the resulting tileset appears to be completely misaligned and won't render properly in ...
stix's user avatar
  • 111
1 vote
0 answers
81 views

Rendering Performance CloudOptimizedGeotiff Band calculation

Displaying this 4 band 16int COGTIFF file size approx 4GB in leaflet via https://cms.geo.admin.ch/Topo/umweltbeobachtung/satromocogviewer.html?url=https://data.geo.admin.ch/ch.swisstopo.swisseo_s2-...
scriptDaddy's user avatar
2 votes
1 answer
123 views

How do I modify S57 data converted using ogr2ogr so that it correctly exports on qgis2web?

I have some unencrypted ENC charts with file extension .000 (S57 data). Using the process and S52 styles at https://www.sigterritoires.fr/index.php/affichage-des-cartes-marines-s57-dans-qgis/ I have ...
James Davies's user avatar
2 votes
2 answers
398 views

Customizing layer control with CSS classes in Folium Leaflet?

I am working with creating a folium map within streamlit. I like the ControlLayer() functionality that folium provides, but I would like to be able to customize it a bit more. I found this comment ...
Binx's user avatar
  • 1,380
1 vote
1 answer
92 views

Map moves every time a marker is added in ipyleaflet

I am trying to create a map that is updated continuously with received data and I have a problem. the map moves every time a new marker is added and it is making it useless as it should be zoomed to ...
Shane roar's user avatar
1 vote
1 answer
97 views

Showing there are multiple features with the same point location using Leaflet while maintaining ability to filter data

I have a dataset of training sessions provided at various sites in Greater Manchester. The training sessions have different names, but in many cases, the sites may be the same. Here is a short example ...
Chris Pope's user avatar
3 votes
1 answer
110 views

Leaflet offset of tiled layer WMTS layer

Adding in Leaflet a WMTS layer with the 'L.tileLayer' to a COG Tiff results in an offset. Both services are in the same EPSG:2056 system This code <html> <head> !-- Version 2.0 --> &...
scriptDaddy's user avatar
1 vote
0 answers
124 views

Leaflet maplibre gl use custom CRS

I need to use CRS 2056 with leaflet and maplibre leaflet-maplibre-gl.js to display vector tiles. Using this code <html> <head> !-- Version 3.0 --> <!-- full stretch --> &...
scriptDaddy's user avatar
1 vote
1 answer
136 views

Leaflet and maplibre remove a layer from a vector tiles style set

Using maplibre-gl-leaflet I want to load an existing vector tiles styles from style.json and remove its background raster layer with the id "swissimage" and then add a raster dataset URL ...
scriptDaddy's user avatar
0 votes
0 answers
61 views

Geocoder search with autocomplete GeoJSON properties data in Leaflet Map

I'm using L.Control.geocoder to search my map by address and coordinates, but I wanted to do an autocomplete search using data from the GeoJSON properties.Nemesis file. Is it possible to add this ...
Cesar Fonseca's user avatar
-2 votes
1 answer
112 views

How to use AJAX request to filter WFS data?

I want to create a mash-up that shows sites in Italy on a basemap. With the AJAX call I want to include the number of earthquakes within a certain distance to each site. I want to use the AJAX call ...
Alm's user avatar
  • 83
1 vote
1 answer
87 views

Gamma correction of Sentinel-2 imagery using Leaflet

Image Stripes after applying a Gamma correction after normalization with this Sentinel2, 4 Band DN using Leaflet (Complete Code) with this code: <body> <div id="map"></div&...
scriptDaddy's user avatar
1 vote
1 answer
218 views

COG TIFF multiband in Leaflet

I am attempting to display a 4-band Sentinel image where the RGB bands are the first 3 bands, each represented as uint16. Reason: Currently viewers like COGEO tinyurl.com/3jy9jjcy do stretch each COG ...
scriptDaddy's user avatar
1 vote
0 answers
78 views

Converting Leaflet polygon to GeoJSON?

I have the following piece of code of my Leaflet application (Typescript): getPolygonMarker(): GeoJSON { let itemShape: any = [ wktToGeoJSON(item['contour'],) ]; const p = new ...
smartmouse's user avatar
3 votes
1 answer
114 views

AJAX calls for leaflet

I want to create a mash-up showing sites on a basemap as I did in the first part of my code. With the AJAX call I want to include earthquakes so that the pop-up of each site shows its name However, I ...
Alm's user avatar
  • 83
1 vote
1 answer
137 views

Are lines drawn on most web maps wrong? [closed]

Lets imagine a shortest path (on the surface of earth ellipsoid) between CA, US and Greenland. Also lets add a point on the middle of that path. If we now draw the path as a line on a map using ...
ristiisa's user avatar
1 vote
2 answers
95 views

Leaflet - Customer Tile Cache Scheme Review, Munich

I am interested in user-specific tiling schemes and serverless display with Leaflet. I have come across problems that I cannot solve on my own. There are older requests in the forum for the display of ...
Christian Naujoks's user avatar
0 votes
0 answers
93 views

How to set iconAnchor at the center of markers icon?

The following is how I can center the markers icon with given size. L.marker(center, { icon: L.icon({ iconUrl: `<my-custom-icon.png>`, iconSize: [17,36], iconAnchor: [...
smartmouse's user avatar
2 votes
1 answer
295 views

Find correct URL for WMTS Time layer for Leaflet

So I have this WMTS-Layer (the GetCapabilities Request): https://wmts.marine.copernicus.eu/teroWmts/GLOBAL_MULTIYEAR_WAV_001_032/cmems_mod_glo_wav_my_0.2_PT3H-i_202112?request=GetCapabilities& ...
Lenn's user avatar
  • 1,297

1
2 3 4 5
84