Questions tagged [leaflet]
An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps
862
questions with no upvoted or accepted answers
3
votes
0
answers
5k
views
LeafletJS How to set custom map scale for a flat image map (CRS.Simple)
I've been trying to get a flat image fantasy map working within LeafletJS. I have pretty much everything working well except for the map scale legend where two things are not working:
I can't seem to ...
3
votes
0
answers
1k
views
Leaflet: get the color of a specified pixel on the map
I need to get the color of a specified pixel on the map. How can I do it using the current API of Leaflet?
3
votes
0
answers
783
views
Leaflet filtering existing featuregroup
I have a leftleat map and i would like to filter the featuregroup i am displaying.
exp_colJSON = new L.geoJson(exp_col,{
onEachFeature: pop_col,
pointToLayer: function (feature, latlng) {
...
3
votes
0
answers
1k
views
Adding an offset to a Leaflet TileLayer on the fly
I'm currently using Leaflet to display 18th century maps of Belgium as a base layer with a vector overlay of the present day road system. Although the maps are absolutely gorgeous (http://www.ngi.be/...
3
votes
0
answers
507
views
TypeError: L.Proj is undefined in leaflet
I am using leaflet 0.7.3. I am trying to load a wms tile:
var crs = new L.Proj.CRS('EPSG:2236', '+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=...
3
votes
1
answer
1k
views
Send viewparams GeoServer using Leaflet
I need to pass my longitudes and latitudes of origin and destination for a SQL view in GeoServer to get a WMS layer with the route.
I've performed in qgis to view and is working perfectly.
This is the ...
3
votes
0
answers
324
views
Creating polygons for a choropleth map using PostGIS
I have a grid of points, each with a value to it as shown in the image below. The data was retrieved from PostGIS and rendered in Quantum GIS. The final result should be a polygons of a choropleth map ...
3
votes
0
answers
902
views
Raster Over Layer in Leaflet from GeoServer
I want to add a raster over layer onto the base layer and the raster layer is published by a Geoserver WMS. I set the raster layer's geographic coordinate system as the same as the cloudmate tiles. ...
3
votes
0
answers
566
views
Format tilelayer.wms URL properties such that I add an overlay iteratively to my base map in Leaflet
My base map was created using hard-coded template variables. I am using the leaflet tilelayer.wms constructor and including the URL like so:
url: "http://localhost:8080/geoserver/sf/wmsservice=WMS&...
3
votes
0
answers
3k
views
How to serve OpenStreetMap Tiles locally using ArcGIS Server 10?
We want to serve OpenStreetMap Tiles locally using ArcGis Server 10 to use as base maps in our ESRI Silverlight and Flex GIS clients.
We've downloaded our regions OSM file and created PNGs using ...
3
votes
0
answers
744
views
How do I pass a LatLng Bounds from Leaflet to Mapfish Print?
I successfully fired up a MapFish print server on Elastic Beanstalk, and it prints out the sample spec files fine, but I'm trying to pass bounds from my Leaflet frontend now, and encountering a lot of ...
3
votes
0
answers
2k
views
Overlaying a mbtiles tile layer produced with tilemill over another layer maintaining transperency
So using leaflet, I'm overlaying my base tile layer as google satellite imagery. I want to overlay another layer (Mbtiles layer) produced with tilemill over this satellite layer. I was successful in ...
2
votes
0
answers
343
views
How to rotate folium CustomIcon
I have dataframe; it has name, latitudes, longitudes and heading.
Heading value will between 0 and 360. According to the angle we need to rotate.
I printed my dataframe items inside folium map in ...
2
votes
0
answers
353
views
Mbtiles to plot in map using react-leaflet
I am new to map technology and I am using react-leaflet to plot GEOJSON to map. It was all going well but then I m facing load time with massive GeoJSON data, so need to convert GeoJSON to mbtiles. ...
2
votes
0
answers
188
views
TIFF image layer doesn't show on Leaflet map
Trying to display an image as layer on a Leaflet map but having some trouble. I don't know what I'm doing wrong.
%pip install segment-geospatial groundingdino-py leafmap localtileserver
import ...
2
votes
0
answers
81
views
Unwanted different line thickness in multipolygon's shared borders
I have a multipolygon in a Leaflet map in a R Shiny app. There is always one subpolygon selected to be displayed while the other subpolygons are hidden (i.e. it's fill is transparent and the others ...
2
votes
1
answer
926
views
Add a fill pattern to feature style instead of a fill color on a certain condition in Leaflet
As a continuation to Hatch polygons in Leaflet
I'm using Vue and Quasar but I would love to see any type of example. What I have is
statestyleCDC(feature) {
return {
fillColor: this....
2
votes
0
answers
953
views
How to remove a marker from a Leaflet map?
I'm currently making a website where I'm using Leaflet 1.7.1 and Nominatim API and VueJS 3 and I'm trying to delete the marker after I search an address. When I search the address the first time ...
2
votes
1
answer
672
views
Prevent map click event when clicking on Leaflet control
I have added a slider from antd to Leaflet map, but when I clicked to slider it's also run map onclick event. I have tried to stop propagation but it only works with button.
Here is my code:
<div
...
2
votes
0
answers
453
views
Leaflet get bounds of whole map
My map is a rectangle, divided in smaller x-y-z images.
map.getBounds() returns the bounds of the visible map. I want to compute the bounds of the whole map, from corner to corner, regardless of the ...
2
votes
1
answer
151
views
CRS.Simple coordinates from SVG for GeoJSON in Leaflet
I am working with CRS.Simple in Leafleat. The y-coordinates from the SVG don't match what I'm supposed to use in GeoJson. I do not want to calculate them manually. How to use coordinates from SVG so ...
2
votes
0
answers
523
views
Leaflet unit-testing - layer removal (jest)
I want to test if FeatureLayer is removed from the map instance, but somehow
instead of expect(removeCallCount).toBe(1) I have 0. What can be the problem?
test("FeatureLayer removes itself from ...
2
votes
0
answers
497
views
How to clip GeoTiff according to shapefile using javascript?
Situation: I am plotting data provided in a GeoTIFF file on a map using Reactjs and geoTiff.js. An example of the GeoTiff files I am using is at the following link: https://drive.google.com/file/d/...
2
votes
0
answers
346
views
Drawing buffer zones in React-Leaflet
I am working with a Leaflet in react.js and using react-leaflet-draw. I can't draw a buffer on shapes drawn by react-leaflet-draw. Just like a “leaflet-buffer”.
2
votes
0
answers
3k
views
Leaflet/Vue 3 Issue Uncaught TypeError: Cannot read properties of null / this._map is null
I am facing an error on Leaflet on Vue 3 whenever i try to zoom in or out when a popup is closed. The error on Mozilla:
Uncaught TypeError: this._map is null Popup.js
and the error on chrome
...
2
votes
0
answers
192
views
Leaflet Directive performance issues with 7539 GEOjson features
I'm using this example for my map but it seems that the map performance is pretty bad when zoomed. Currently the map have 7539 geojson objects (features) and in the future they will be around 9500. I ...
2
votes
0
answers
340
views
Filtering and Styling WFS GeoJSON
My problem is two-fold. I am trying to load a WFS as a geojson on my map. The WFS contains universities and their information. When the map loads, all universities should be displayed, and on ...
2
votes
0
answers
101
views
Leaflet in R: ArcGIS Server custom CRS mismatch
I am trying to use tiles from the ArcGIS Server in Leaflet, but I can´t get the projection right. The tiles use a specific projection which I defined, but when I plot them on top of a base map it is ...
2
votes
1
answer
329
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
0
answers
1k
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 ...
2
votes
0
answers
2k
views
Remove default OpenStreetMap tile layer in Leaflet - Folium?
I have multiple maps in my Folium map (map1 and map2) however, I see OpenStreetMap as the default option. I want to remove the OSM option altogether and keep just my two custom layers. If I set tiles ...
2
votes
0
answers
283
views
LeafLetJS TimeDimension: accumulate the features on the map
I have configured a leaflet timedimension layer according the code bellow. The point features are displayed only when the player receives the feature time and when the time is over the features are ...
2
votes
0
answers
460
views
Leaflet - adjusting improper y axis between zoom levels
I'm currently data mining a game, and I pulled out the in-game map files (and converted to png). The images are 1024x1024 (pixels). I am currently in the process of learning Leaflet (and gis in ...
2
votes
1
answer
2k
views
Editing a GeoJSON layer that I just added to the map
I have created a Leaflet map and added a GeoJSON layer like this.
var map_rgb = L.map("map_rgb",{center: [userLat, userLon],crs: L.CRS.EPSG3857,zoom:'{{zoom}}',zoomControl: true,preferCanvas:...
2
votes
1
answer
864
views
Using ArcGIS Online PBF from FeatureServer in Leaflet
I'm looking for a way to use the PBF format from an ArcGIS Online FeatureServer in Leaflet.
There are lots of examples using L.vectorGrid.protobuf with URLs for PBF tiles structured like {z}/{x}/{y}....
2
votes
0
answers
1k
views
Leaflet popup immediately closing
In my map (http://www.enjoytheparks.com/EtP_Map.html) I display "special" popups for Park Points of Interest. To see this, you would have to select a park first. Easiest way is use the ...
2
votes
0
answers
901
views
Polygon intersection using turf js
I have given this code for intersection:
function intersectPolyByPolyFC(poly,fcPoly){
var fgp=[];//variable for feature group
var bbPoly=turf.bboxPolygon(turf.bbox(poly));//polygon ...
2
votes
0
answers
1k
views
Plot "large" raster with leaflet in R
I have a geotiff that is around 26MB on my hard drive. I would like to use leaflet to plot it within a shiny application.
However, it just doesn't load. When I use mapview just to plot it locally it ...
2
votes
1
answer
543
views
Rotation of a cropped portion of a raster map
We create printed maps from a GeoTIFF file projected in LCC, which is a common projection for aviation maps. Part of our process includes customization of the raster image by selecting a region and ...
2
votes
0
answers
230
views
How to Select Site Point then Zoom to Polygons
The map has a farmLayer of points and a paddockLayer of polygons. (In some countries farmers use the term field instead of paddock.) When the farm is selected with a double click the farmLayer is ...
2
votes
1
answer
235
views
What routing system support off-road routing for Leaflet integration?
I have a collection of regionally specific linestrings and multi-line strings which are off-road paths. I would like to be able to integrate these into a Leaflet routing systems which would ...
2
votes
0
answers
212
views
GetFeatureInfo with leaflet.extras2 and Shiny
I am building an R Shiny App that utilizes the following WMS. However, the GetFeatureInfo capabilities for click-enabled popup (leaflet.extras2 functionality) returns a summary of the GetCapabilities. ...
2
votes
0
answers
2k
views
Highlight polygon on mouse over in Leaflet?
I am doing a map on Leaflet and I would like to know how to put my polygons highlighted visually in some way when they are covered with a mouse a bit like that: http://www.gistechsolutions.com/leaflet/...
2
votes
0
answers
4k
views
Specifying legend location in folium
I have a few choropleth maps in one Leaflet map using folium. However, in my output, my legends all congregate underneath one another and on one side where it blocks the 'control zoom' icon.
Is there ...
2
votes
0
answers
638
views
Leaflet.js custom coordinate system
Background:
Display topographic plans of a specific size (1500 meters x 1500 meters). The source images of tiles can be of different sizes and resolutions. It is required to display on the plan some ...
2
votes
0
answers
2k
views
Leaflet nested layer control
I'm trying to build an interactive game map with Leaflet and I would like to implement nested layer groups. I tried doing it the obvious way: putting some layer groups inside of a "master" layer group,...
2
votes
1
answer
250
views
Using spTransform CRS in Leaflet
I am producing Kernel density estimates for animals from tracking data.
Location is input at x y data, I produce a spatial polygons dataframe from these coordinates.
xy<-id[c("X", "Y&...
2
votes
0
answers
2k
views
Why does leaflet treat an svg file differently in an image overlay than a png file and how can I prevent this?
I have a vector graphic in adobe illustrator format (ai).
I would like to partially (only some layers) display this graphic as a basic map. I exported most of the layers of this vector graphic as ...
2
votes
1
answer
547
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 ...
2
votes
0
answers
206
views
Passing Leaflet object geometries to a parametric SQL view in GeoServer
I have a parametric SQL view for a WFS layer in GeoServer with the simplified form:
SELECT pts.id AS id, pts.geom as geom
FROM schema_name.points_table pts
WHERE ST_Contains(%g%, pts.geom);
I want ...