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

learn more… | top users | synonyms (1)

2
votes
0answers
9 views

How to edit an existing layer using leaflet?

I am used to working with OL3 and I wanted to try using leaflet and see if it is as powerful as OL. I loaded a map with some data from a GeoServer WFS layer using this tutorial from Georepublic. var ...
2
votes
1answer
239 views

Showing link for every city at different zoom levels using Leaflet?

I have a Leaflet map that I am using to render a map of the U.S. The map will have specific zoom levels. For example, when the map first loads it will show major U.S. cities. Then if you zoom in it ...
2
votes
1answer
314 views

Load Leaflet map in canvas element

I am working with leaflet tiles loading tiles to a map div http://jsfiddle.net/tBCd5/ I am now playing with some html5 canvas distortions like below http://jsfiddle.net/UF4PK/ It would be cool to ...
2
votes
0answers
22 views

how to efficiently detect intersect between polygons?

So I'm trying to implement box selection in leaflet. Currently i'm using turf's intersects function to detect if the box intersects with any of my geojson polygon features. However, this is very ...
2
votes
3answers
123 views

Leaflet/HTML/GeoJSON: How to put a pop-up on a geoJSON point?

I don't have much knowledge of HTML/JS/GeoJSON, and have made a webmap from trial and error with many different tutorials. I have tried leaflet's tutorials but cannot get the desired results. I have ...
10
votes
5answers
4k views

GeoJSON too bulky - what to do?

I am using leaflet.js to allow web users to select a region. Valid regions are US states, Canadian providences, and world countries (except for US and Canada). I constructed a shapefile myself using ...
0
votes
1answer
16 views

How to change info div based on baselayer selection?

I'd like to change the map logo in a info div based on the baselayer selection. For what I understood I have to use events but dunno how. Here is my code: <!-- Add LOGO --> var info = L....
0
votes
2answers
22 views

Add logo to a map using Leaflet/Mapbox

I am currently trying to learn how to use Leaflet / Mapbox (and JS, to some extent) by creating custom test maps. My problem is that I want to add a logo on the top of my map, with absolute ...
1
vote
1answer
270 views

A problem with event firing upon mouseout

I'm trying to create a point map that displays information about a point in an info box upon user mouseover and changes the styling of the point. On mouseout, I want the info box and marker styling to ...
1
vote
1answer
318 views

Pass coordinates parameters to geoserver pgrouting service from Leaflet wms tile layer

I've configurated a pgRouting service in Geoserver, following the steps on the documentation it's easy to accomplish. Reading the documentation, existing examples, etc.. I've come to undestand how ...
1
vote
1answer
42 views

Load multiple GPX files to Leaflet map

Considering I have a folder that contains multiple .gpx tracks, my objective is to show each of them in a single leaflet map. Then I would personalize thing like tooltips of each track, the color for ...
0
votes
1answer
439 views

Creating Leaflet layer that can be toggled in layer control from CartoDB viz.json?

How do I create a leaflet layer that can be toggled in the layer control from a cartodb viz.json? I have read that the cartodb.createlayer does not create a leaflet layer. It seems you can add the ...
1
vote
2answers
279 views

Leaflet and census block data: not displaying

I am new to leaflet and am trying to load a geojson file showing census blocks and associated information for a city in CA. It is a small city and not too many census blocks. I cannot get the popup ...
0
votes
0answers
13 views

Leaflet - Edit Feature Attributes in popup [on hold]

I'm looking to make attributes shown in my click popup editable. I've been piecing together from Leafletjs and many search sources but have hit a wall. GitHub Index Here is a sample I've found which ...
0
votes
0answers
25 views

Add user inputted markers to leaflet from mongodb

I want to allow users to input geojson points via a form then be able to get the points using an ajax call to display them on a leaflet map. I think I am messing up the ajax call which gets the data ...
0
votes
2answers
24 views

Pass Leaflet Draw Marker to Turf.js point

I am trying to dynamically supply turf.point([coordinate array]) with values from leaflet.draw markers. I can only find hard coded examples for all turf examples. I hope my goal is clear here. I ...
0
votes
1answer
1k views

Positioning leaflet divIcon when adjusting size using css

I am using the L.divIcon when using iconSize:null which is causing iconAnchor:[0,0] to not be recognized,my code looks like this: var divIcon =L.divIcon({ className:'current-location-icon', ...
0
votes
1answer
33 views

Passing values for a geojson filter in Leaflet

I have a situation where I have a geojson layer in leaflet and I want to create a subset of this layer as a separate geojson to highlight specific features. What I am doing right now is passing in ...
4
votes
3answers
988 views

Looking for a GeoJSON describing the french departments

Is there any place where I could find a GeoJSON describing the borders of the French departments, or do I have to convert a shapefile?
2
votes
2answers
56 views

Convert/display grayscale image as RGB

i want to display raster images using a color palette in a leaflet map. The images are tiled (gdal2tiles) from a single .tif to multiple .png files with values from 0 to 100. I add the image using ...
0
votes
1answer
26 views

Leaflet popups - preserving user input on close/reopen

I am working on a Leaflet map that allows a user to open a popup by clicking on a geometry and then generate dynamic content within the popup. However, I find that on closing and then reopening the ...
0
votes
1answer
230 views

Leaflet GeoJSON style function feature only colors one GeoJSON feature

I need to style every feature differently that I pull from a GeoJSON file. However this anonymous style function only changes the style on the first feature it comes across and stops. I am new to ...
0
votes
1answer
26 views

Convert TIF to PNG for Leaflet map

I have a single-band, georeferenced .tif file that I would like to display on top of a Leaflet.js map, using the ImageOverlay function. Unfortunately, Leaflet seems only to accept PNG or JPG files, ...
0
votes
0answers
5 views

dynamically upload maps on GeoServer [duplicate]

I want to write a webGIS that supports uploading Raster and Vector maps dynamically. When someone upload a map, it should dynamically upload on GeoServer. I develop based on leaflet library in ...
1
vote
1answer
593 views

Polygon intersection with bounding box with polygon's holes intact

I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building ...
6
votes
1answer
732 views

How to add an offset to a GeoJSON layer in Leaflet?

Using the example GeoJSON tutorial code at leafletjs.com. Change the myLines variable so that the two lines overlap, but run in opposite directions as follows: var myLines = [{ "type": "...
0
votes
1answer
19 views

leaflet - change routing vehicle when clicked on button

I want to change the routing vehicle when clicked on a button. The default routing vehicle is "car" ("auto") when clicked a button routing vehicle should change to "foot" ("pedestrian"). I am using ...
1
vote
2answers
35 views

How can I get a QGIS2Web project to display info for multiple layers in a popup?

I have built a project in QGIS and QGIS2 Web that has multiple polygon layers that overlap each other. I am trying to get the info pop up to display the data for all of the overlapping layers at a ...
1
vote
1answer
20 views

How to edit specific geometry on leaflet layer

I am starting working on a new, quite complicated functionality and I want to ask for some guidance regarding the way to implement it. The final aim is to give to the user the possibility to edit data ...
1
vote
1answer
249 views

Is there any method to retrieve SQL queries into a GeoJSON file using JSP?

I want to display the contents of my PostGIS database of various shape-files in leaflet pop-up dynamically. I know there are static methods available that retrieves attributes. But I need to by ...
0
votes
1answer
18 views

Using leaflet or google map to create layer of multiple attributes

I am creating a map with leaflet layer. Right now, each marker has three different attributes and I would like to create layers base on these three attributes (Model, group, and status). I am able to ...
0
votes
1answer
55 views

Mapquest API & OpenLayers markers

Not unlike others, I've found myself forced to edit some code due to MapQuest changing how they offer the openstreetmap data, and using an API Key. Getting the key, aswell as getting up a simple ...
0
votes
0answers
27 views

Leaflet route while dragging error with mapzen valhalla

I have added a router to my leaflet map and would like to enable the routeWhileDragging function. When I do this with the mapzen valhalla router I get the following error; lrm-mapzen.js:88 GET https:/...
0
votes
0answers
12 views

How to extend Geocoder (Nominatim) with own/distinct address

I want to extend my Geocoder for my leaflet routing map. I am using leaflet routing machine and nominatim geocoder to implement routing and geocoder. Now my goal is: I want to put an a specific ...
0
votes
1answer
34 views

Can't load geoJSON files in Leaflet layer control

First of all, I have to sorry about my English. May not be perfect. I have a problem with show my geojson files into layer control. I read every topic about that on this side, i have tried on a milion ...
0
votes
0answers
17 views

What code is needed to query a openlayers3/leaflet map-layer-field and to zoom to the result? [closed]

I need to display a map on android-tablets and to query a layer and to zoom to a selected item from the query-result. As a search-function is not implemented in the great QFIELD app until now, I ...
0
votes
1answer
268 views

serving UTFgrid information made with mb-util with leaflet

I've created the mbtiles file with tilemill and exported it on my ubuntu webfolder with the following command: mb-util --scheme=xyz /folder/tile.mbtiles /var/www/html/my-tiles To get utfgrid ...
1
vote
1answer
700 views

Add an event listener on a Marker in Leaflet

I am using leaflet in order to render a map. I created a map with markers and i dont know how to implement the Event Listener 'onClick' on each Marker. My code var stops = JSON.parse(json); var map ...
2
votes
1answer
23 views

change width of outline for leaflet map depending on zoomlevel

I want to change the outline of a polygon depending on the zoomlevel. I thought it's easy to implement but there must be something wrong. My polygons dissapear when I try it with this code: to get ...
0
votes
1answer
313 views

Convert Leaflet WMS layer to Leaflet GeoJSON layer

Using the Leaflet API I am adding a WMS layer through the L.tilelayer.WMS feature. This feature includes only a certain amount of options such as 'layers','crs','style' etc. Through the Leaflet ...
0
votes
1answer
10 views

White PNG pulled from mapserver stored in PGSQL using leaflet

I have a polygon layer stored as a table within PostGIS/PostgreSQL using SRID 3857. I have created a MapServer layer pointing to this layer. However, when I try to load this layer into Leaflet as a ...
3
votes
1answer
82 views

Rotate geojson feature with Leaflet

I have a GeoJson feature that is rendered with leaflet and proj4(ESPG:31467). Now I want to rotate that feature so that it NW corner points to NE, e.g. 90 deg rotation. Is there a way to do this? Or ...
3
votes
2answers
47 views

What is an appropriate tileLayer source for tiles served on an apache localhost through leaflet?

--I found a solution. Please, see answers below.-- I've been trying for about about 25 hours to get a working, locally hosted, tile server running, using this guide from switch2osm. I have a ...
0
votes
2answers
24 views

Geoserver WMS layer is hiding the basemap in a Leaflet map

When I add two layers to a Leaflet map (a basemap and a Geoserver WMS), the basemap disappers. But when its tiling, it can be seen for a moment. What's the problem? Maybe it's due to the transparency ...
0
votes
1answer
33 views

CartoDB- popup window not working

I am working on a project, and I have not worked with cartodb long, but there is something wrong with this code. It is supposed to display a little pop window showing the school district for that ...
0
votes
1answer
36 views

Animated GEOJSON path invisible in Leaflet

i have been trying to animate a path over a leaflet map using the following example from Mike Bostock: http://bl.ocks.org/zross/6a31f4ef9e778d94c204 After i make my own json and put it into code, i ...
1
vote
2answers
19 views

Add Leaflet layer based on variable with the same name?

I have a geojson layer named mapLayers and another geojson layer named lmiCounties, with a dropdown list with an item with the id lmiCounties. I want the second layer added to the first, which has ...
0
votes
2answers
31 views

Leaflet Sidebar - set content depending on clicked GeoJSON feature

My goal is to set the content of the sidebar depending on what GeoJSON feature was clicked on. For example when clicked on polygon A the content of the sidebar is: "This is A" and when clicked on ...
6
votes
2answers
238 views

Access GeoJSON from GitHub in Leaflet

I am new to JSON, GitHub, and Leaflet. But I am trying to create a simple application which will render my points which are in GeoJSON up on GitHub. From everything I have read this should work. ...
0
votes
1answer
353 views

How to draw a rectangle on a Leaflet map from GeoJSON data

I am trying to draw a rectangle on a Leaflet map with JSON data which looks like this. var geojsonfeatures = {"type":"FeatureCollection","features":[ {"type":"Feature", "geometry":{"...