Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

Make text color in innerHTML change depending on value in GeoJSON

When I hover over different counties on my map, a div updates whether or not the county voted republican or democratic in the 2020 election (among other things). It will either say it voted republican ...
0
votes
0answers
23 views

Geofences in Leaflet with live Location

I'm a newbie in terms of programming. I'm building a Web App with Angular and Leaflet, which has to locate the users position and notify him in case he is close to specific buildings. There a several ...
-1
votes
0answers
34 views

What GIS software can be used for SCADA display rendering [closed]

What simple database,mapserver and client combination can be used to view and draw custom maps from scratch? I am looking for a (modern, open source) software stack for rendering large SCADA displays, ...
0
votes
1answer
42 views

Use of Leaflet to display raster image from WMS GeoServer

I'm trying to display raster images from GeoServer on a Leaflet map. Simply like this: var map = L.map("mapid").setView([15.6261, -61.44361], 13); var wmsLayer = L.tileLayer.wms('http://...
1
vote
1answer
46 views

Connect corners of two rectangles via SVG line in Leaflet

Assuming I have two rectangles on a leaflet map with CRS.Simple, how can I use svgOverlay to draw a <line> that connect top left corner of the two rectangles? I'm having issue with spatial to ...
0
votes
0answers
17 views

PostGIS raster dynamic styling on Leaflet map

We are currently using GeoServer to load a raster from PostGIS onto map. But we need some other way, so we can dynamically change its styling. We want to add a color slider on a Leaflet map by which ...
0
votes
1answer
33 views

Loading data from array in popup when country is clicked in React Leaflet

I'm newbie and I have interactive web in react using leaflet library and now I need to load "title" data from array to a map. So when I click on some country, popup will show up with this ...
1
vote
1answer
22 views

Turf.js dissolve features not adding to Leaflet map

Trying to dissolve features with boundaries that touch with Turf.js. They all have a common attribute that is specific in the Turf option example. Console loge console.log(regionsDissolved) results in ...
1
vote
1answer
17 views

Bind tooltip to a marker as a result of turf.js distance method in Leaflet

I'm trying to simply put the results of the distance variable in the tooltip but keep getting undefined. I don't understand what's happening. function findDistanceToCentroid(countyPolygon, ...
0
votes
0answers
18 views

How to make div update with zoom level?

I have a div that updates with mousehover. For example, when you hover over GA it displays the data for GA, when you hover over NC, it displays the data for NC, etc. I want to have the same div, but ...
2
votes
1answer
51 views

Make data layer disappear and different one appear on click in Leaflet

I'm mapping COVID vaccinations per state and per county in the US. I have state data as well as county data displaying properly. I'm trying to make it so that when I click on a state it zooms in to ...
5
votes
2answers
94 views

Styling popup with two separate styles at once in Leaflet

I have the point layer as you can see below: where the semicircles are fine but points not necessarily. I would like to customize these points as well. The problem is, that I can't find a good option ...
1
vote
1answer
11 views

Leaflet draw layers disappearing after creation in Django

I implemented leaflet in my Django project, and managed to add the draw functionalities. The thing is after i draw the shape instantly disappears. What should i do to solve the problem? map.html {% ...
4
votes
1answer
56 views

Variable nested inside another variable not displayed properly in popup in Leaflet

I would like to set my popup content. Some of the information will be condition-based. I tried the following options: onEachFeature: function (pointFeature, layer) { var stream = function(liveStr){...
0
votes
0answers
36 views

Dynamically scale line weight in Folium (polyline or antpath)

I draw lines and ant path in folium and I need to scale width of line for example 12 km width line but I can't use simple weight because it has dynamic width that changed when zoom in or out loc = [[...
-1
votes
1answer
62 views

Circle with direction pointer in Leaflet

I am new to Leaflet and I am using leaflet 1.7.1. My need is to put some custom markers on map. I am currently using circles (as in: L.circle([lat, lon], {radius: rad}).addTo(map);) as markers (note ...
0
votes
2answers
49 views

Mapleaflet- Latitude and longitudes are properly not getting plotted

I am using Leaflet (Mplleaflet) to plot and display a simple polygon of an area on a map. I took the points, correctly, from Google Earth but it is not plotting the coordinates on the city of Kolkata ...
1
vote
1answer
44 views

Get coordinate index from array on GeoJSON data in Leaflet

I have GeoJSON data with linestring feature type. I will display this data using L.geoJson() function. The data has properties of rotation for each coordinate. I want to create a marker with that ...
1
vote
0answers
53 views

Setting target URL for each polygon when clicked using Leaflet

I have created a map using Leaflet and QGIS2Web. I want to set a target URL for each of the polygons, so that when a user clicks on a polygon, it takes them to the URL. Currently, when they click on ...
0
votes
0answers
40 views

How can I have Leaflet search engine to look through multiple columns rather than just one column in the Attribute Table of my QGIS map?

I have created a map using Leaflet and QGIS2Web. The search engine works fine, however it looks through only of common of the attribute table. How can I have it look through four columns? map....
0
votes
0answers
38 views

How do I prevent leaflet search function to first zoom to the center of the map rather than directly going to the correct location?

I have created a map using leaflet and QGIS2Web. The search function of the map works strange. When I search for something (an African language), it first zooms in to the center of the Africa rather ...
1
vote
1answer
43 views

Layer events loading GeoJSON feature geometries using Leaflet

I am using Leaflet 1.7.1. I want to add simple tooltips to poly-layer after they are constructed. I tried everything. External onEachFeature() function featureGroup. But it seems that events the ...
0
votes
1answer
43 views

Issues with Leaflet and WMS map BoundingBox

Our application uses Leaflet to display various kinds of maps (TMS, WMS, WMTS, XYZ etc.) as well as GeoJSON objects on the map. The problem is in how we define and use the WMS maps and layers. We're ...
1
vote
1answer
30 views

How to make legend have no number overlap in Leaflet

I'd like my legend to go from 0-25 to 26-50 to 51-75 rather than what it is in the screenshot included. How should I go about doing that? function getColor(d) { return d >= 75 ? "#...
1
vote
1answer
28 views

Adding"no data" square to legend in Leaflet

I want to add a square above the red one in my legend that is Grey and says "No Data". How do I do this? var grades = [0, 25, 50, 75]; function getColor(d) { return d >= 75 ? "#...
1
vote
1answer
50 views

Styling Points of Vector Grid in Leaflet

I am using the Leaflet Vector Grid Plugin to load a geojson innto my Leaflet project. But I can't figure out how to implement a popup and style the data by attributes. I load up the data with ...
0
votes
1answer
36 views

Leaflet Tilelayer from Mapbox with URL restrictions

I’m having great difficulty with this topic. I’m building a Gatsby/React mapping web app for the Swiss paddlesports community (GitHub repo) using Leaflet to load a custom tile layer from Mapbox. I’d ...
0
votes
0answers
40 views

Styling and adding pop ups to leaflet-geojson-vt

TDLR: Is it possible to style and make vector tile layer interactive? I implemented a geojson file with the leaflet-geojson-vt plugin. Is there any chance I can style the points with a function and ...
0
votes
0answers
23 views

PostGIS WMS raster data - pixel values shifted on different zoom levels

I'm quite new to working with geo data, specifically with PostGIS and currently trying to understand the following phenomenon. I have some raster data stored in a PostGIS database and use this PgSQL ...
1
vote
0answers
28 views

Adding ArcGIS Online Feature Layer to Leaflet project

I have a hard time adding a simple feature layer from my ArcGIS Online account to a Leaflet project. This is my approach: <script src="https://unpkg.com/esri-leaflet/dist/esri-leaflet.js"&...
1
vote
1answer
48 views

Loop to add groups and layers based on user's checkbox choice

I have a number of layers that I would like the user to choose from a checkbox to feed the map. All these layers are based in a WMS call, controlled by a user input string. All working properly The ...
1
vote
1answer
31 views

Creating GeoJSON symbolization for points by name in Leaflet

I have a GeoJSON with several hundreds objects and I add it on Leaflet map. I want to create another symbolization for some object. But I don't understand how to change color and size for some of the ...
1
vote
0answers
65 views

GeoJSON to vector tile in EPSG:4326 with Leaflet.vectorgrid

Goal Display a fairly large GeoJSON point dataset as vector tile in Leaflet v1.7.1 with the Leaflet.VectorGrid.js plugin. Also, use the popup feature to display all properties. Code and input data ...
0
votes
0answers
27 views

Problems with AutoPanning in Leaflet

I've built a simple Leaflet map with Popups showing some information. Most of the time the Autopanning works just as intended and the map moves to show the whole content of the popup, but sometimes it ...
1
vote
0answers
17 views

Removing previous markers when new markers are added

Actually, I am using leaflet map to display city markers when country is clicked. Everything works fine. But, when I click on new country, the previous country markers remain on its position. Now, ...
0
votes
0answers
19 views

How To Show Labels marker From Database [duplicate]

I want to show labels in my maps, How to show label from database, permanent labels Here's my code: <!DOCTYPE html> <html> <?php session_start(); if($_SESSION['status']!="...
0
votes
1answer
52 views

Page becomes unresponsive

I created a html file using leaflet to add markers to leaflet map using csv data. For parsing csv data I used papaparse. I did the same thing with python folium too and saved the output to a file ...
0
votes
0answers
21 views

Export a specific region from self hosted WMS

I have a question regarding the export function in leaflet. I‘m hosting a WMS Server, based on a SQL Database. This database is filled with images. Is it possible to export the full resolution images ...
2
votes
1answer
74 views

Buffering GeoJSON with custom CRS in Leaflet

We are using a custom CRS for our map in order to use the British National Grid (EPSG:27700), however we have realised now that turf.buffer will not work with it, and appears to only work with Lat/...
0
votes
0answers
25 views

GeoJSON vector labels as paths not as points/divIcons

I'm developing a page with a map using Leaflet. I have an issue with generating the vector based on a GeoJSON. The dxf file is converted to a GeoJSON format using QGIS plugin (Bulk vector export as ...
1
vote
0answers
33 views

Loading BaseLayer with Leaflet from ArcGIS REST

Can someone explain why the second layer isn't working? The page is loading, but the Mosaic shows up blank. I'm new to the world of GIS so I don't know exactly what's different between these two ...
1
vote
0answers
49 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 ...
1
vote
1answer
73 views

Make IDs and classes from GeoJSON properties be seen as IDs and classes of HTML elements in Leaflet?

I've created a GeoJSON with 3 points. This GeoJSON has fields called id and class inside its properties like the following: { "type": "FeatureCollection", "features&...
4
votes
1answer
103 views

Correct CRS options for Proj4Leaflet to show WMTS layer?

I'm new to custom projections in Leaflet, and now I'm trying to set up a Leaflet map that uses a WMTS service for its tiles, with the custom projection EPSG:3008 (SWEREF99 13 30). I'm using ...
3
votes
1answer
103 views

Updating the filter option for GeoJSON layer in Leaflet?

I got this Leaflet sample from the Leaflet documentation for testing how the filter option works. Then I've created the following code (jsfiddle sample here): var freeBus = {/*check the jsfiddle ...
2
votes
0answers
50 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 ...
1
vote
1answer
72 views

Make point markers lead to a webpage link on click using Leaflet?

I would like to make my map markers lead to a webpage link on click but I'm not quite sure how to make that happen. I'm looking for a way to make my point marker lead to a link on click, rather than a ...
0
votes
1answer
59 views

General JavaScript function handling popups of various JSON layers in a Leaflet map

I have a couple of JSON layers added to my Leaflet map via the leaflet-ajax plugin. lyrBldgs = new L.GeoJSON.AJAX('data/bldgs.geojson', {style:stlBldgs, onEachFeature:popOSM}).addTo(mymap) lyrLanduse =...
1
vote
0answers
29 views

How to set wall texture in osmbuilding-leaflet?

I'm working with osmbuilding-leaflet to render 3D features on map but there is a problem. After rendering features wall of buildings doesn't have texture. But in the basic osmbuilding library wall ...
1
vote
1answer
48 views

Keep popup opened on spiderfy events with leaflet.markerClusterGroup?

With the markerClusterGroup leaflet plugin, calling the spiderfy function twice automatically closes the opened popup. This seems to be due to this piece of code in the unspiderfy function, that is ...

1
2 3 4 5
74