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

learn more… | top users | synonyms (1)

0
votes
1answer
9 views

Display Popup from postgis db over WMS layer file using leaflets

i want to display popup information over WMS service file that i published from geoserver and using it Leaflets. Below is the picture for illustration. Now i just want when user click any polygon ...
0
votes
1answer
17 views

Leaflet Tiling with epsg4326?

i'm using leaflet to render a map on my site. The problem is, i use mongoDB to perform some geospatial queries serverside, which use as standard the infamous epsg4326. It appears that on leaflet ...
1
vote
2answers
28 views

Leaflet, changing base map CRS

So i am using leaflet in order to create my project, which is a world map that certain layers would be add on top of it. I am wondering whether I should change the CRS property of the map object, ...
3
votes
1answer
54 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 ...
1
vote
1answer
3 views

How to specify (cross-browser) mouse pointer sets on leaflet control?

Leaflet custom controls might be interactive, when the user can use the mouse on them to perform an action, or non-interactive, when they are used only to show information. This should affect the ...
1
vote
1answer
16 views

Where to get world-wide detailed administrative boundaries?

I'm looking to build a world map that plots all application users and their locations around the world. The initial zoomed out world view would show total numbers clustered by country, then when you ...
3
votes
3answers
75 views

Leaflet - tell whether an object a layer or a group

I need to close popups on an object, but I don't know whether it is a layer or a geoJSON (and hence a feature group). If the former, I can do layer.closePopup(), but if the latter, I have to do layer....
1
vote
1answer
1k views

How do I add elevation data to a GeoJSON line from a GPX file?

I understand that elevation can be added as an optional third value in Coordinates (lat, long, elev) in a geojson file, but I can't find a way to actually do that from a gpx file. I've used ogr2ogr to ...
1
vote
1answer
193 views

Leaflet + GeoServer + British National Grid

I have followed along some examples and was able to display BNG 27700 data nicely on the map, however now I want to perform getFeatureInfo function on click. Again the code I used is as below: var ...
1
vote
1answer
21 views

Issue in loading external geojson file into leaflet map?

I want to load an external geojson file into leaflet map. I created a global variable (i.e. tracts) for json file and referenced this variable in the script file. But i receive an error message that ...
-1
votes
0answers
23 views

How to add two buttons on waypoint to run the code

I'm developing a mobile app and I would like to add one button in each waypoint to be able to run the code. var geocoder = L.Control.Geocoder.nominatim() L.Routing.control({ geocoder: geocoder, ...
0
votes
0answers
11 views

OSMBuildings building:levels are not working

I am integrating Leaflet with OSMBuildings and i am using Classic 2.5D. Everything is working and it is showing 3D building on 2D Map, But The Building levels are not working (I am gone through this ...
1
vote
0answers
20 views

CartoDB.js/Leaflet map - how can I click between multipolygons cleanly?

Here's my map: https://jsfiddle.net/Sidders/4exf969e/3/ I want to apply a click and hover effect to the polygons. So a polygon/multipolygon highlights on hover, and is selected with one click. The ...
1
vote
1answer
294 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 ...
4
votes
2answers
167 views

How to make both hover and click popup work?

I am pretty new to all of this. I want to have a hover/mouseover AND click popup work on my geojson layer. Here is the code so far, but I don't know where to include the hover without messing up the ...
-1
votes
0answers
22 views

Leaflet & Cesium integration for 2D & 3D view [on hold]

I'm not a developer, but please allow me a question. I try to create an interactive map (non-profit) in Leaflet with old town plans (WMS) and add a layer for historical photos (Geotagged Photo Leaflet-...
-3
votes
0answers
15 views

display buffer turf only when i click on a layer [on hold]

I want to display turf buffer only when I click on a layer var pt = { type: 'Feature', geometry: { type: 'Point', coordinates: [lat, lng] }, properties: {} }; var unit = 'miles' var ...
-1
votes
0answers
10 views

Leaflet layer on ol3 map [on hold]

I am using normally ol3. But I had to put leaflet layer on ol3 map Is there any way to overlay leaflet layer on ol3 map? Regards.
1
vote
1answer
34 views

How to start L.Control.Geocoder.nominatim() with user's current location

I'm trying to develop a routing system and I want to know how can start with the user's current location from A point? var control = L.Routing.control({ // waypoints: [null], waypoints: [ ...
0
votes
0answers
21 views

How to add mutiple photos from flickr API on the popup of leaflet.js markers

I want to make a slider of photos on the popup of the markers by taking 5 photos for each location.I have a JSON of few locations of a city.The json has the name, latitude and longitude of the ...
2
votes
1answer
301 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 ...
3
votes
1answer
39 views

How do I set the width and height of a popup using QGIS2Web and Leaflet

I am a newbie to editing javascript. I want to set the Max width and height of the popup that QGIS2Web generates with a Leaflet map (I have quite a lot of text in the attributes and will need a ...
1
vote
2answers
66 views

Set view does not work after Fitbounds

I have a map and a layergroup. var map = L.map('map').setView([27.6758,85.3313], 12); L.tileLayer('http://{s}.tile.cloudmade.com/8ae544230be74379927e6dee5d416398/997/256/{z}/{x}/{y}.png', {}).addTo(...
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 ...
1
vote
1answer
19 views

Access Stamen tiles via https

To get rid of "Mixed content" warnings I'm trying to access stamen map tiles via https. For http the used url is: http://{s}.sm.mapstack.stamen.com/(toner-lite,$fff[difference],$fff[@23],$fff[hsl-...
0
votes
1answer
328 views

map.on('click') event disables the double click zoom

I have a map that has an onclick event fired and displays a marker where the user has clicked. Problem is that this event seems to overrun the double click event. Because of this, when I double click ...
0
votes
1answer
13 views

Leaflet - MultiPolyline constructor and arrays in JSON

I am struggling with the AntPath Plugin ( link to GitHub ) for Leaflet and the documentation is limited and difficult to read. This setup works well(se code-snippet in the end), but instead I want to ...
0
votes
2answers
51 views

Thematic charts on leaflet

In GIS charts are a part of good visualisation , I wonder if I can show a bar chart for example of my ON , OFF passangers in some Bus line here my plunker example my example each stop nodes point has ...
0
votes
1answer
208 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 ...
1
vote
1answer
19 views

Leaflet: Style function does not work for point layer

I'm new to Leaflet and I'm not very proficient in Javascript. I've been trying to create a map visualizing a point layer with custom markers but for some reason the marker style as a function just ...
1
vote
1answer
467 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 ...
3
votes
3answers
79 views

Automatically refresh my wfs layer in Leaflet when adding data in Postgis

I’ve built a web-sig based on postgis, geoserver and leaflet. My polylines, …, are stored in Postgis and I call them through Geoserver in Leaflet as wfs layers like : var defaultParameters = { ...
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', ...
1
vote
1answer
16 views

Leaflet / Mapbox.js: incorrect Popup offset using divIcon with CSS class

I'm having an error which I can't seem to find elsewhere online with Leaflet / mapbox.js regarding the offset of a popup from a marker's custom icon which has been set with L.divIcon and using a CSS ...
1
vote
1answer
19 views

Features disappear from Leaflet after zooming in

I have a Mapbox studio template which already looks the way I want it to, but when I put it in a Leaflet app, after I zoom in past level 17, a lot of the features disappear. Zooming in inside Mapbox ...
0
votes
1answer
428 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 ...
2
votes
2answers
99 views

How to get current scale of a Leaflet map?

I've been looking through the Leaflet API to see if there is a getScale method or scale property of a map, and have't seen anything. Does anyone know if Leaflet provides a way to get the current map ...
1
vote
2answers
588 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 ...
0
votes
0answers
15 views

Parallel visualizing in leaflet shiny

I want to visualize a large number (about 27000) of lines (streets of Amsterdam) on a base map (of Amsterdam), using leaflet and shiny in R. The opacity of these lines changes when a slider is moved. ...
7
votes
4answers
4k views

How do I stop event propagation with rightclick on Leaflet marker?

I didn't find a rightclick event in Leaflet markers so I started listening to the mousedown event. In the method that resolves this event I check if (event.originalEvent.button == 2) { ...
0
votes
1answer
276 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
20 views

Export csv-coordinates to JSON - square brackets [closed]

I´ve got multiple point-layers that I want to join in a single JSON-file used for webmapping. The layers is to be listed in column by column like this: [55.778659,12.151137 ], [55.77272358,12....
0
votes
1answer
51 views

Create buffer around point with Turf

This code is not working and I don't know why? function getlatlong(b,d){ return b,d; } function buffer(feature){ var point = { type: 'Feature', geometry: { type: 'Point', ...
0
votes
2answers
25 views

How to access array inside of Leaflet LayerControl?

When you make a Leaflet LayerControl you first make an array of markers, then pass the array to the LayerControl constructor and add the LayerControl to the map, like this: myLayerGroup = L....
1
vote
2answers
42 views

Is there an editor for Leaflet JavaScript that has intellisense functionality?

Is there an editor for Leaflet JavaScript that has intellisense functionality? I've tried both Visual Studio 2015 and Visual Studio Code ... in 2015, if I type code like var geojsonlayer = L and ...
1
vote
1answer
34 views

Displaying raster images using Leaflet?

The purpose is to create a small web application using an open source product, preffered Leaflet (but I will Switch the product if it works within another Framework than leaflet), simply showing a ...
0
votes
1answer
25 views

What SRS does leaflet use when it creates new markers?

I'm using leaflet 0.7. I'm wondering what spatial reference system is used when a new marker is created? Also, how does this impact my use of maps? (I'm using leaflet .7 because of dependency ...
1
vote
1answer
233 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 ...