Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet]

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

0
votes
2answers
74 views

JavaScript remove Leaflet layer when checkbox is unchecked

I have an JS object where the 1st value of each key is the checkbox id, 2nd is the API where the data is and the 3rd is the color var layers={childcares: ["#childcares",'http://127.0.0.1:8000/...
0
votes
1answer
20 views

Text in layer toggler in Leaflet is really faint - why?

I have added a layer toggler using Leaflet and geojson but the text of layer names is too light to see in the toggler - how do I style the text in a darker colour? It's on a wordpress site, if that ...
0
votes
0answers
38 views

Editing attributes of a GeoJSON in Leaflet

I have a map in which I'm trying to create the capabilities of adding new features and editing attributes of new and existing features. I have managed to make the feature editable but I want people to ...
0
votes
0answers
15 views

Which tool to use in order to create map? [duplicate]

What I am trying to do is to build a website with some maps for areas for a certain PC game. I just don't know where to start. How does one create a map? Do I need first to acquire a background ...
0
votes
0answers
9 views

When I click on the Temporal Slider Buttons, I dont see a significant different in the symbol size

I have created a Time Series Proportional Symbol map in Leaflet JS. My data is: States population from 2010 - 2018, and there isn't a big difference in the population of every two years. So now when I ...
1
vote
2answers
62 views

Leaflet extension: “this.callInitHooks is not a function”

I am trying to develop a leaflet function but I am getting this error which I am having trouble understanding. This is my plugin code thus far: L.Spotlight = L.Class.extend({ options: { ...
2
votes
0answers
24 views

Use leaflet-draw-toolbar with angular 2

Is it possible to use leaflet-draw-toolbar with angular 2 and ngx-leaflet-draw? I do not see, and I am not versed in Angular 2, enough, to incorporate the JS library for leaflet-draw-toolbar into my ...
1
vote
0answers
30 views

.svg image is not loaded into webview in android

I'm using leaflet and trying to load .svg image on webview. `//Create the bounds and image to add. var imageUrl = mapData.plan.image; var imageBounds = [[mapData.plan.size_x, 0], [0, ...
0
votes
1answer
28 views

Extract timestamp not defined using Leaflet Time Slider?

I am new to coding, so there may be many things wrong with my code. I am trying to build a Leaflet time slider for some point data. The geojson data is of sites where water was sampled for mercury ...
0
votes
0answers
42 views

Creating Leaflet Heatmap using LinsString GeoJSON

I need to create heatmap based on length property from a LineString GeoJSON file. I have tried to use Leaflet.heat plug-in, but this tool accepts points not lines. here is my code: $.getJSON("data/...
0
votes
0answers
96 views

Visualize big data HTML file created with Folium

I have written a Folium map of a French city with the possibility of visualizing attributes informations on click for each of its polygon which makes a huge file after 2 hours of calculation with the ...
0
votes
0answers
37 views

Use clickEvents in shiny with tmap

You can use clickEvents for the tmap package in shiny as in this example for leaflet in shiny. However, I don't know how to acces the click events. On each click an Id is given, but where is this id ...
0
votes
1answer
82 views

Change Leaflet Marker Icon(.png) color programatically [closed]

I have a list of markers. I am assigning an icon to each marker and creating that icon from a black .png circle. I want to change color of that marker based on input value from user. I have searched ...
0
votes
1answer
88 views

Converting JSON response into a GeoJSON layer in my Leaflet map

I need to convert a JSON response from Mapquest elevation API into a GeoJSON layer in my Leaflet map. var ele = $.getJSON('http://open.mapquestapi.com/elevation/v1/profile?key=<API_KEY>&...
0
votes
0answers
19 views

Leaflet.browser.print remove print options

How to disable print options and leave only one option. Or how to make it possible to click directly on the button and the list did not appear. One-click printing I still see all possibilities ...
0
votes
0answers
33 views

Calculating elevations using Mapquest elevation API?

I have a Leaflet map that contains options for users to draw lines, i need to enrich the drawn lines with elevation data from Mapquest elevation API. here is my code: drawData = drawnItems....
0
votes
0answers
47 views

How to create a map-based survey with drag-drop capability?

I am an urban planning master student. I need to create a map-based survey for my research. The survey should allow users to drag some different points from the toolbar to the map showing next to it. ...
1
vote
1answer
64 views

Leaflet: Different custom information popups for each GeoJSON polygon

I'm really new to this and I'm trying to create popups for 2 polygons which will each contain a paragraph of written information. The function I have so far differentiates between the 2 polygons by ...
0
votes
0answers
21 views

Create a SVG layer for Leaflet from GeoJSON

I had a large GeoJSON and I display it with vectorgrid plugin for Leaflet. I want to add another layer based on the main GeoJSON with only the name of the building and display it in vector format (not ...
0
votes
0answers
49 views

Merge shapefile data within the same spatialpolygonsdataframe in R, when not all data have the merge column populated?

I have a 156Mb shapefile of New Zealand polygons down to the individual suburb level. There are 7,369 polygons. Each polygon has a unique ID (1...7369) in an ID column. There is a Suburb column ...
0
votes
1answer
105 views

Leaflet add data to GeoJSON without showing on map

I am adding using GeoJSON data pulled from a service. I want to load the GeoJSON layer but I don't want to display the data on map. This code is adding myLayer with the default blue color to the map. ...
0
votes
1answer
50 views

Zoom to selected feature extent using Carto and Leaflet

I am trying to use the getBounds and setBounds functions to zoom to the extent of a selected polyline feature in Carto. The feature has been selected using an SQL query. I want to zoom to the extent ...
0
votes
0answers
32 views

Toggling off/on heatlayer using geojson file

I created a heatlayer using a geojson file. However, I am having trouble with toggling it on and off with a checkbox. Since the toggleHeatlayer function is within another function, it becomes ...
0
votes
1answer
48 views

Changing marker shape to circles in Leaflet

I was wondering how to change the default marker shape in a Leaflet map to circles $.ajax("data/StatesPopulation.geojson", { dataType: "json", success: function(response){ ...
0
votes
0answers
40 views

ODK Aggregate PostGIS and MapServer WFS with attached images

I am using ODK Collect to collect ground data. The data collected are stored into a PostgreSQL/PostGIS database then I publish them as WFS through MapServer and read them with Leaflet (Leaflet-WFST ...
1
vote
1answer
85 views

qgis2web leaflet: change position of layers control box [duplicate]

I exported a leaflet-webmap with qgis2web. On the top-left, there are the controls (like zooming, serching etc.). On the top-right, there is the layers control box (checking/unchecking the layers of ...
0
votes
0answers
38 views

Basemap layer is over the WMS layers

I have the problem that the WMS layers are hidden from the basemap, I try to solve the problem with the zIndex but it does not work. Any other ideas? WMS Layer var two = L.tileLayer.wms('http://...
1
vote
2answers
165 views

Calling OpenWeatherMap API in Leaflet.js map

How to get weather data from OpenWeatherMap API in a popup by clicking any location on the map? i am still new at calling APIs in my map, API return JSON files but i don't know how to call the API in ...
3
votes
0answers
87 views

Add Line Layer from PostGIS to Leaflet

I have a line layer in PostGIS that I would like to add to a Leaflet map. I have the PHP setup, but I can't seem to get the Javascript correct. I know my issue is converting the line to geoJSON. The ...
0
votes
0answers
54 views

Leaflet custom icons and popups showing GeoJSON properties with external data?

How can both custom icons and geojson properties be implemented with external geojson in Leaflet? Using methods described in answers to two other questions, both using inline geoJSON: Using custom ...
0
votes
2answers
41 views

Executing functions after multiple data sources have been loaded in Leaflet AJAX

I have a leaflet map that takes in data from multiple sources via the LeafLet Ajax plugin. I want to execute certain functions only after ALL the data has been loaded, not just one layer. The data ...
1
vote
1answer
93 views

Leaflet: get layer in GeoJSON with pixel coordinates instead of lat long coordinates

In my Angular 7 project with ngx-leaflet and leaflet 1.4.0 and leaflet-draw 0.4.14 I want to export each drawn rectangle (and circle,...) to GeoJSON. That works fine using public onDrawCreated(e: ...
0
votes
0answers
70 views

R : How to build heat-map based on ratios with leaflet package

I'm just starting to try out some things in the GIS arena and perhaps this question is a concept mistake. I've read the post R : How to build heatmap with the leaflet package and the fantastic answer ...
1
vote
0answers
63 views

Disable map dragging ONLY when touch - sliding transparency slider [closed]

I am wondering if anyone knows how to replicate this, but specifically with touchscreens in mind: //disable dragging when cursor is over the element opacitySlider.getContainer().addEventListener('...
0
votes
1answer
66 views

Calculating gained elevation on GeoJSON

I need to calculate gained elevation on Multilines GeoJSON files in a Leaflet.js map. Is there is any plug-in to do that? My GeoJSON files contains Z/elevation data in geometry.
1
vote
2answers
42 views

Reduce complexity of KML file

I have a 6mb KML file I am using with the Leaflet API/Ominvore plugin. It is just a centerline of a long distance trail. What would be the best way to make it smaller? Reduce complexity etc.
1
vote
2answers
54 views

Getting hightest and lowest points

I have GeoJSON files that contains altitude values. I have used these GeoJSON files to be shown on leaflet.js web map. I need to show values of highest and lowest point in two divs when I clicking on ...
0
votes
1answer
48 views

Integrate JSON file inputs (specifically latlng) in Leaflet with JS

It's my first time using Leaflet and I wanted to simply put two markers based from my inputs. I managed to connect my JSON file with the JavaScript and the only problem I have is how to dynamically ...
0
votes
3answers
228 views

Filtering interactive leaflet-map with dropdown-menu?

I try to set up a filterable "shot chart" like http://graphics.latimes.com/kobe-every-shot-ever/ with leaflet. I've a geojson file thats stores all the shots data, I've them showing up in a layer. ...
0
votes
1answer
84 views

Leaflet: how to select a feature by property

I have a geojson layer with continents info (got it from here), and I want to select a feature(continent) based on its name value or "CONTINENT" in this case. I did some research and ended up with ...
1
vote
1answer
50 views

How can I get GeoJSON from Esri software to load in Leaflet?

So I am trying to take a GeoJSON file that I have generated from an Esri shapefile in ArcGIS Pro, but it is not rendering on the map for some reason... The GeoJSON that was created from ArcGIS Pro is ...
0
votes
0answers
41 views

Example for request GetCapabilities to get bounding box of WMS layer [duplicate]

Please share an example in which a getcapabilities request is fired on the geoserver for bbox of a specific layer? Note:- I have seen answers in which method is given but no example of a request is ...
-5
votes
2answers
64 views

Leaflet-JS Not sure what is wrong with my script below

I have posted a screenshot of my index.html and JavaScript file. The problem is that It doesn't display any webmap. the only thing I can see is the head(h1 from my html. Any thoughts on this?
2
votes
1answer
58 views

Creating a rectangle using leaflet / turf.js

I have written some code which creates a rectangle at the position of the user's cursor. There does not seem to be any method to do this in turf.js itself. And of course using the latlong-based ...
1
vote
1answer
96 views

Changing anchor point for popup without marker using Leaflet?

Is it possible to change the position of the anchor point for the popup without using markers? I was testing with this example. This code shows a popup, but I want to adjust the position of the ...
1
vote
1answer
85 views

Using Leaflet elevation profiles with multiple GeoJSON features?

I have a GeoJson file that contains many routes, i need to show each route on an elevation profile via Leaflet.elevation plugin, in need to when i click on a route it's profile show on the elevation ...
0
votes
2answers
38 views

Changing a markers location at set intervals

I am trying to plot coordinates of a marker using a GeoJSON feature. I am able to plot my points fine but my issue is, when the interval happens the old marker stays on my leaflet map rather than ...
0
votes
0answers
30 views

Leaflet WMS layer label disappears on zoom [duplicate]

I am populating a tileWMS layer on my map (also created through Leaflet) through Leaflet from GeoServer which is working fine but the issue I am facing is with visibility of labels. On various zoom ...
0
votes
2answers
49 views

Displaying GeoJSON using Ajax and Leaflet?

I have been trying for days to load a GeoJSON file using Ajax and Leaflet. I can get the map & index.html to load using an Apache server and such but the GeoJSON itself does not show up. Here is ...
1
vote
0answers
81 views

Draw a polyline around a route to act as geofence with leaflet routing machine [closed]

I am using leaflet routine machine to get a route between 2 points. I want to be able to draw an invisible polyline around the route and use this as a geofence and if the user goes out of the bounds ...