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

1
vote
2answers
65 views

Using Leaflet inside Bootstrap container?

I have problem rendering leaflet map in a webpage using bootstrap. I have two columns col-4, col-8 in a bootstrap container. the col-4 has some text and col-8 has to render the leaflet map. But the ...
0
votes
1answer
29 views

Using Leaflet Search plugin with GeoJSON layer (L.Control.Search)

I have a map with a single GeoJSON layer that I referenced in my script (using the AJAX plugin). Now I am trying to add search functionality to the map so that the user can search for features by name....
0
votes
0answers
16 views

Converting L.GeoJSON Leaflet to different projection?

so I have some awesome basemap raster layers that use L.TileLayer to load, but the GeoJSON I have for my country polygons is all Web Mercator. My tile map is WGS84 or EPSG4326 (I think). But I ...
0
votes
1answer
16 views

Adding Altitude to a marker in WebGLEarth

Im trying to add an altitude to a marker in WebGLEarth but i cant figure out how to do it. I cannot find anything in documentation either. The idea is that my markers act as satellites so i need the ...
1
vote
0answers
23 views

GeoJSON query with invalid format export

I have created a simple PostgreSQL/PostGIS query for export to GeoJSON. Here the query : SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' as "type", array_to_json(...
0
votes
1answer
36 views

Turf intersect point with Leaflet GeoJSON error

Leaflet and Turf. I am trying find all the layers on a Leaflet map that intersect a point when the user clicks on the map. I am using the turf library to test for this. In the console when I click on ...
1
vote
1answer
28 views

adding dialog plugin qgis2web

I have exported my webmap using qgis2web and while playing with it, I was able to change the settings of the items already present on the map (for example position, language, zoom levels, etc.) ...
0
votes
1answer
20 views

R leaflet plot with ETRS89

I am new to GIS and R leaflet, and I am trying to plot the starting points of protected rivers in Spain. Example of coordinates from the original file: Nombre.de.los.cauces.principales Coordenada.X....
2
votes
2answers
42 views

Leaflet: Detect failed zoom attempt

I would like to detect whenever a user tries zooming but fails due to reaching minZoom/maxZoom of the map. From what I understand, zoom/ zoomstart/zoomend will not be fired as there is no actual ...
0
votes
1answer
15 views

Leaflet z-index above everything else [duplicate]

I have a problem with leaflet : the control layers are always above everything else in my webpage. Does anyone know how to fix this ? My code creating the map var src_str = component.get('v.srcPath')...
0
votes
0answers
32 views

White sides ar marker popup

I like Leaflet a lot. But I want to ask how to remove white sides in the popup ? I manage to turn of padding but it only removed top and bottom, but sides still stand. I will insert a image and it ...
0
votes
2answers
56 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
15 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
23 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
14 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
32 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
16 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
17 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
22 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
25 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
40 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
25 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
50 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
71 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
11 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
25 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
29 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
votes
0answers
46 views

Export GPX files from a Leaflet.js map

I have a Leaflet.js map that contains tools for users to draw lines, i need to create an option to export lines in GPX format. I have used (togpx) plug-in to convert drawn GeoJSON to GPX to download ...
1
vote
1answer
45 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
16 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
29 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
42 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
27 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
29 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
37 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
31 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
52 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
33 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
91 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 ...
2
votes
0answers
73 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
47 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
32 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
44 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
40 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
32 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
48 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
votes
0answers
12 views

Dataset of lines at n miles from the coast

I'm using Folium to generate some interactive maps with ocean data. One of the restrictions I am facing is that the objects, I plot has to be at-least at 5, 6, .., n miles from the coast, hence I am ...
1
vote
2answers
34 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
51 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 ...