12,757 questions
1
vote
1
answer
50
views
Map not rendering with Leaflet.js
I'm returning to leaflet.js and I am unable to render the map with the tutorial from "Leaflet Essentials"
When I save the file as an .html and open it, there is a blank webpage. I assumed it ...
Tooling
0
votes
2
replies
92
views
How to implement an interactive alumni map with clustering and sidebar in React (Leaflet or Mapbox)?
I am building an alumni networking web application where I want to display alumni locations on a global map along with a sidebar list.
I want to implement the following features:
A world map with ...
0
votes
0
answers
79
views
React Leaflet(js) Position Issue with ImageOverlay
I've been building a react component which uses Leaflet.js. I have a custom map image which ive put in as an ImageOverlay. I'm capturing map points from a different system and calibrating the ...
0
votes
0
answers
25
views
Triggering Change Event in Leaflet and jQuery [duplicate]
I am using leaflet.js to create a map and add a select box to the map. That works, but the change event, which used to work, does not work anymore.
I start by creating the two objects that I need, the ...
Advice
0
votes
0
replies
81
views
How do I reference my own Openstreetmap tiles in Leaflet
I have followed the instructions for installing Mapnik, PostgreSQL, OSM2pgsql, etc as detailed here:
https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-24-04-lts/
However, the ...
2
votes
1
answer
99
views
How do I reactively change legend values inside an R Shiny Leaflet map?
I'm working on an interactive mapping tool using shiny and leaflet which will allow users to navigate through various filters, basemaps, shapefiles, and point data. The problem I am running in to ...
0
votes
0
answers
55
views
How do I create labels for protomaps pmtiles data in Leaflet.js?
I created some pmtiles files. I used tippecanoe and ogr2ogr, with various settings. My goal is: show the files with protomaps-leaflet.js. I already have some leaflet projects with basemaps, geojson ...
3
votes
1
answer
123
views
R's leafem not appending Layers Control with customizeLayersControl(includelegends=T)
Working on a leaflet map with a large number of groups that creates a bulky legend. To trim down the legend, I'd like to hide it away in the Layers Control with customizeLayersControl from the leafem ...
1
vote
1
answer
130
views
Leaflet marker icons intermittently disappear (shown as “?”) in WKWebView on iOS, even with data-URI icons
Context
I’m embedding a Leaflet map inside an iOS app using WKWebView (BeeWare/Toga, but this seems WebView-level rather than framework-specific).
Problem
Leaflet’s default marker icon and shadow ...
2
votes
0
answers
51
views
why bounds in fitbounds of leaflet are not valid?
I have this map:
<l-map
ref="mapRef"
:use-global-leaflet="false"
>
and wanted to fit the map based on bounds which calculated in this way:
bounds.extend([lat, lng]);
...
0
votes
1
answer
105
views
CircleMarker SVG classes/animations not updating reliably when reactive state changes
I’m using Vue-Leaflet + Leaflet to display dynamic CircleMarkers whose styling depends on reactive Vue state.
When a marker enters the list, it should fade in via CSS.
When it leaves the list, it ...
1
vote
1
answer
90
views
How to find coordinates of a polygons vertices
I have a React application that uses React leaflet to render a map and I can draw a polygon on the map using a function I've written. I want to submit the polygon that's drawn to an SQL database and I ...
0
votes
0
answers
74
views
Leaflet.VectorGrid with multiple interactive layers
I build layers based on L.vectorGrid.protobuf(). Each layer has interactive: true. Each works perfectly for click, mouseover and mouseout, but only in isolation.
When I have multiple layers only the ...
1
vote
0
answers
130
views
why markers need to be tapped twice to have the popups opening in the right position (inside the leaflet map)
This part of code should rule popups behaviour
if (isMobile) {
map.on('popupopen', function (e) {
const popup = e.popup;
const el = popup.getElement();
if (!el) { // Se l'...
1
vote
0
answers
31
views
TypeError: L.control.sideBySide is not a function in Leaflet
I am integrating the leaflet-side-by-side plugin into a large existing Leaflet WebGIS application (InMap) that uses Bootstrap/jQuery and has complex layer management (L.control.autolayers).
Despite ...
Advice
0
votes
0
replies
78
views
How do I migrate and import my interactive maps from fandom.com to my GitHub repository for use as GitHub Pages
I used to have a wiki on Fandom but the service doesn’t like it if you have a private wiki, so I asked the WikiTeam on GitHub, who are not affiliated with Fandom, to export dump my entire wiki on ...
2
votes
1
answer
134
views
How to set the color of a Polygon?
I have a React application that lets a user draw a polygon using the following code:
function handleClickToggleDrawing(): void {
map.pm.enableDraw('Polygon', {
snappable: true,
...
-1
votes
1
answer
91
views
Color picker not responding to user inputs
I am working on a react application and I want to show a color picker in a modal, but the color picker doesn't work. It's rendered to the screen, but the user can't change colors. Could I get some ...
1
vote
1
answer
247
views
How to make a component show on top of MapContainer?
I have a react app that uses React-Leaflet. The Application renders a map, and on top of the map there should be a component that shows a modal. Instead, the modal is shown underneath the map. How can ...
0
votes
1
answer
146
views
How to implement onclick function for a map made with React Leaflet
I have a map that I've made in React Leaflet which lets the user draw polygons, and i want the user to be able to click on the polygon and render a modal which lets the user name the area that's ...
Advice
1
vote
4
replies
99
views
Which paradigm and tech stack for an app that listens to messages and updates shapes on a satellite map
I am taking advantage of StackOverflow's new "General advice" question type to present my use case and ask for technical guidance.
I am a Data Scientist with several years experience in ...
3
votes
1
answer
147
views
Is it possible to auto-adjust the zoom when rendering large leaflet maps into png?
With the following code one can generate a leaflet map:
library(leaflet)
library(mapview)
library(dplyr)
library(sf)
bbox <- st_bbox(my_polygon)
print(bbox)
xmin ymin xmax ...
-1
votes
1
answer
134
views
React React-leaflet and MarkerClusterGroup, can't access property "useState" error
i have more than 13300 points of interests to show on a map.
i have created a app with starter react app, react-leaflet and react-leaflet-markercluster
but i have this error "can't access ...
0
votes
1
answer
64
views
What is the equivalent of onclick for textInput in R Shiny leaflet popup?
I'm working on a Shiny app with a leaflet map that allows users to change names of points using popups. The idea is that you can click on a point, see the name and edit its textInput. The problem is ...
0
votes
1
answer
128
views
draw mode in react leaflet not working consistently
I'm trying to implement a feature that lets the user draw polygons on a map in a react application that uses react leaflet as the map library. The drawing sort of works, but placing the vertices is ...
-1
votes
1
answer
63
views
Share cached fetched tiles among many instances on the same page
Sometimes I need to have more than one LeafletJS map on the same page. That is, I instantiate two or more LeafletJS Map objects which they share the same geographical vicinity (say 200km x 200km) but ...
0
votes
0
answers
179
views
React Leaflet Polyline keeps re-rendering and flickering during map interactions (zoom/pan) - how to make it stable?
I'm using React Leaflet to display a map with vehicle tracking points connected by a Polyline route. The issue is that when I zoom in/out or touch/drag the map, the Polyline route keeps re-rendering ...
-2
votes
2
answers
123
views
Uncaught ReferenceError: require is not defined, in my Vercel app
Problem
I have a React app using Leaflet.js (v.1.9.0) and I host it in Vercel. Building works OK, but when visiting my app online logs this message in console:
Uncaught ReferenceError: require is not ...
0
votes
0
answers
94
views
How to use ACF OpenStreetMap Field plugin in Wordpress with zoom setting?
I'm trying to figure out how to use Leaflet.js that's inside the ACF Openstreetmap Field Plugin. I found a code that was helpful and I was able to modify to display the map on my wordpress website.
...
0
votes
0
answers
78
views
visualize interactive map with heatmap layer, color as a function of distance to points
I want to create an interactive map with a heatmap layer on it. The color should reflect a score which is calculated from the distance to coordinates. The coordinates are amenities (like public ...
-1
votes
1
answer
205
views
Vue 3 leaflet doesnt load map correctly
I'm making a custom map for leaflet using vue 3.
It only loads 4 tiles in a row( loads more tiles when i zoom, but within that same area, equivalent to the initial 4 tiles) - it does seem to load more ...
0
votes
0
answers
97
views
Forge Viewer 2D: Transform Leaflet-authored SVG markups to PDF/Vector space when the Leaflet page is rotated
I’m using the Autodesk Forge Viewer on 2D sheets. Markups are authored in Leaflet space and need to display in PDF/Vector space (i.e., when switching to PDFLoader).
I have two scenarios:
Both loaders ...
0
votes
0
answers
68
views
Populate folium TimestampedGeoJson features using lambda functions?
I am following some code examples to plot time aware coordinates on a folium map using the folium.plugins.TimestampedGeoJson method. As in the example, I'm using a for-loop to tie coordinates and ...
0
votes
0
answers
44
views
markers overlap in some cases but not always in leaflet
I'm making a page for searching public pianos around the world. To point out where the pianos are and what condition are they in im using leaflet markers with diffent colors. My problem is that in ...
1
vote
0
answers
60
views
leaflet canvas renderer prevents click and hover events on other layers
I have a fairly simple leaflet map, on which I display several polylines. to which I bind popups.
I use the default SVG renderer, and it works well, the mouse pointer turns to cursor when I hover a ...
0
votes
1
answer
123
views
How to make my custom SVG markers in Leaflet do not move while zooming
I'm trying to create custom SVG markers using L.svgOverlay in Leaflet. The markers are implemented as SVG <g> elements. They work correctly when I zoom in and out: they stay at the correct ...
0
votes
1
answer
103
views
Remove color from a specific shape in a Leaflet Application
I have built a leaflet application and imported a shapefile to define various locations. I then have a list of the defined regions on the left side and each region has some clickable icons on them. ...
1
vote
0
answers
84
views
Leaflet map markers click event not working in certain scenarios
I've been working on creating a map with dozen of grouped markers, it works fine for the most part, but in these two scenarios markers stop working:
When browser zoom is above 100% (for me, 150% ...
0
votes
1
answer
107
views
Map disappears when other divs are added below or above
I am trying to display a LeafletJS map along with some other divs with tabular data but the map does not show.
When I have only the themap div in my HTML the map appears fine:
...
<style>
html, ...
0
votes
0
answers
116
views
How do I display GeoJson data from Folium map in NiceGUI?
I'm unable to display on screen or terminal the data from an on click event on a Folium/Leaflet map within a NiceGUI interface. As per Folium API I've been able to display coordinate clicks on the map ...
0
votes
0
answers
89
views
Use flutter-map to load Baidu Map tiles
The tile slicing rules of map services like Google, Gaode, and OpenStreetMap (OSM) differ from those of Baidu Maps primarily in two aspects:
Origin of the Tile Coordinate System:
For Google, Gaode, ...
0
votes
0
answers
180
views
How to Make Leaflet Work Fully Offline in React Without Storing Tiles Locally?
I’m working on a React + Leaflet mapping solution for Dynamics 365 CRM. I’d love your help understanding how to truly support offline maps in Leaflet using React — without manually storing tiles.
I’ve ...
0
votes
0
answers
164
views
Facing type issues in node modules ../../node_modules/@types/leaflet/index.d.ts:2504:60 - error TS1109: Expression expected
I am getting error while creating the build for my app. But even trying multiple solutions like skiplibcheck, @ts-ignore, @ts-nocheck, upgrading and downgrading the version of react-leaflet library ...
0
votes
0
answers
62
views
react-leaflet-draw "QGIS-add ring" hole in polygon
I did not find an answer, so I hope it's a new question.
I'm using react-leaflet and react-leaflet-draw in a UI, and I want to define a polygon that includes one or more holes (inner rings).
Example ...
0
votes
0
answers
52
views
How can I have 3 different Geojsons from different Javascript files as overlays with just one layer control button in Leaflet
I currently have 3 JavaScript files displaying GeoJSON as overlays on my Leaflet Map. How can I group them together to have just one toggle button in the Layer Controls?
Overlay 1 is Building
Overlay ...
2
votes
1
answer
164
views
Change property of GeoJSON by clicking on a Map using Dash and Leaflet
Currently my code looks like this:
import dash
from dash import Output, Input, State, html, no_update
import dash_leaflet as dl
import osmnx as ox
import json
from numpy import dtype
# Style-Funktion ...
0
votes
0
answers
91
views
Drupal 10 - How to display a list of nodes associated with a selected location on a map, both in a side panel and a map popup
I have a feature in this Drupal system I'm working on which has a map view (using Leaflet) that shows all terms under "Location" with the polygon as the highlighted area of the location. It ...
1
vote
1
answer
91
views
How to add subtitles in a Leaflet layer control of overlay groups?
I'd like to show subtitles in the control box for overlay groups of a leaflet map created in R. I found some examples (for instance https://github.com/ismyrnow/leaflet-groupedlayercontrol) but not ...
0
votes
0
answers
106
views
Simple example using Addon "Leaflet Custom Headers"
I'm trying to write a simple file for testing Leaflet Plugin "Leaflet Custom Headers".
Some discussion about the Plugin's purpose has been written here: https://github.com/Leaflet/Leaflet/...
0
votes
1
answer
205
views
Why do I keep getting errors when attempting to get current position in JavaScript?
I have an html, css, js project with a map using leaflet. Sometimes location works but most of the time I get errors. Here is my JS code:
onst map = L.map('map').setView([30, 0], 3);
L.tileLayer('...