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

learn more… | top users | synonyms (1)

2
votes
2answers
794 views

How to tell if a GeoJSON path intersects with another feature in Leaflet?

I have an application where the user draws a path (a series of connected straight lines) and this path may not intersect any feature in a particular GeoJSON layer. I need to check that no point along ...
1
vote
3answers
2k views

leaflet-routing-machine add waypoints, routing summary

I'm playing around with leaflet-routing-machine (https://github.com/perliedman/leaflet-routing-machine) and have 2 questions about it's usage: 1) I have the following code now routeControl = L....
1
vote
1answer
246 views

Leaflet popups events through CartoDB

How I can use the leaflet popups events throught CartoDB. I have seen that some events are working like 'click', 'movestart',but 'popupclose' and 'popupopen' are not working. My goal is to do some ...
0
votes
1answer
42 views

Select one feature of multiple overlapping features (here polygons) on a Leaflet map

I have a map with multiple polygons rendered on it which can overlap eachother. I use leafletPip.pointInLayer(point, layer) from https://github.com/mapbox/leaflet-pip for determining which polygons do ...
4
votes
1answer
4k views

select two markers & draw line between them in leaflet

I am very much new to leaflet. I have multiple markers plotted on my map in leaflet. now I have to draw line between two markers when I select them. Can any one help in doing this.
0
votes
0answers
38 views

Mapzen Turn-by-Turn routing in Leaflet Routing Machine with costings: “multimodal”

I wanto to setup a routing service for my leaflet map. The Route should route over pedestrian, train or bus. Mapzen Turn-by-Turn Routing is exactly providing this by using the option: costing: "...
3
votes
1answer
437 views

Leaflet.label and MarkerCluster problem with zoom dependent add/remove layers

Here's the setup: I have a leaflet map with point data, to which I have applied leaflet.label and leaflet.markercluster. I add the clustered point data at a particular zoom level (code below). All ...
1
vote
3answers
566 views

How to load geojson from geoserver to define a variable in leaflet?

How can I load a geojson file from geoserver in leafletjs? There are lot of suggestions out there, but none of them work for me. Currently my app loads a js file from the server that starts like this:...
0
votes
1answer
27 views

leaflet: javascript scope issue within geojson onEachFeature function

I'm new to javascript and even newer to Leaflet (version 0.7.7), so I'm having difficulty determining how to ask this question. With leaflet, when I click on a polygon, an ajax request is made, it ...
1
vote
1answer
184 views

How can track marker clicks in Leaflet?

How can I view which markers are being clicked on by users in Leaflet?
8
votes
2answers
6k views

Disable leaflet interaction temporary

How can I temporary disable zoming/draging the Mapview in Leaflet.js Tried so many ways but without any luck. It's important to make it temporary and I also need the option to enable again.
6
votes
1answer
86 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
1
vote
1answer
838 views

How can I project geojson borders on the google earth tiles in leaflet?

I started working with leaflet and google earth tiles. I want to add borders on my map so I tried to use the countries geoJson Data as a layer on the map. The problem is that the json borders ...
2
votes
1answer
239 views

Leaflet removing labels when any popup window is shown

I am newbie to leaflet and i found the following solution to add static labels to features in my map: L.CircleMarker.include({ bindLabel: function (content, options) { if (!this._label || ...
1
vote
3answers
250 views

Load a really big geojson to a feature layer in leaflet

I have this geojson file(about 60mB) that contains the administrative area boundaries. I want to make a chloropleth and give color based on each geometry properties value and add it to the ...
0
votes
1answer
22 views

Highlighting or marking property using node id in leaflet?

I am working on openstreetmap using leaflet.js, I found some difficulties in highlighting a way(road) using it's node ID of OSM data. I need to know is it possible or not?
1
vote
1answer
196 views

Add multiple strokes to Leaflet geojson feature path

Wondering if it's possible to add multiple strokes to a polygon or line feature (the same thing could apply to multiple fills for polygons too). The leaflet documentation on the L.Path style options ...
3
votes
1answer
2k views

How can I make a leaflet control open by default?

I'm using leaflet to display a map. I have a control section that I'd like to be open by default, but I can't find a way to do it through the API. Is there a way to do this?
1
vote
1answer
18 views

Leaflet - CRS.Simple custom scale?

I am displaying a gamemap using Leaflet. The map is nonwrapping. I use L.CRS.Simple which is recommended for this (and makes sense). I add multiple tilelayers, each created using gdal2tiles. The ...
0
votes
1answer
31 views

How to update position of markers with “real time gps coordinants”?

I've got real time gps positions for a few cars and I want to create a map with updating markers. My code works but it doesn't "update" the markers, instead it adds new objects with new coordinates to ...
2
votes
0answers
35 views

Leaflet.Draw only edit GeoJSON

I am trying to enable editing of a GeoJSON layer in my Leaflet map using Leaflet Draw. I need to allow only a single edit at a time before saving the results back to the database. I tried to implement ...
0
votes
1answer
281 views

Using Leaflet: How do I get it to display one popup based on a condition?

Using Leaflet: How do I get it to display one popup based on a condition. See below. basemap_0.addTo(map); var layerOrder=new Array(); function pop_thunder(feature, layer) { ...
-1
votes
0answers
11 views

How to apply levels to building using height?

I am using OSMBuilding classic 2.5D and leaflet versions, here i am not understanding how to apply levels to building using building height ? I have applied to geojson properties like "levels": 9, ...
0
votes
0answers
31 views

Write latlng array to gpx file

So I have this small application that stores some GPS values along a route as var position = [lat, lng, height] objects in an array. Now I would like to export this array as a .gpx file. I ...
0
votes
1answer
36 views

Adding drop-down menu to leaflet map to update map/tiles to new location?

What I want to do is create an interactive choropleth map that has a dropdown menu of various countries so that the map updates when you click on that country. As an example, here's an interactive ...
1
vote
0answers
26 views

GeoJSON path using d3

I've been trying to make an animated path using d3, JSON, and a list of coordinates. This is the result in JSFiddle: http://jsfiddle.net/5m35J/92/ As you can see, there is a red dot in the corner, ...
0
votes
1answer
2k views

Bootstrap navbar and leaflet zoom controls

I'm using the THE MAP GUY(DE) Bootstrap temple and applying it to leaflet using the code below. The issue I'm having is that the zoom-control doesn't toggle right on page load. It will only after ...
2
votes
2answers
200 views

Simplify GeoJSON by retaining external boundaries (clustering)

I created a website (http://www.cartescolaire.paris) that basically loads a GeoJSON and displays it on a map using Leaflet. This geoJSON is pretty large (over 2 Mb), the loading time can be very long ...
0
votes
0answers
36 views

Debugging Uncaught SyntaxError: Unexpected token : from WFS in Ajax request?

I am trying to insert a WFS layer into a Leaflet map; therefore I need to enable jsonp and want the output in json/geojson so Leaflet can consume it. However, I keep getting an error that I suspect is ...
0
votes
1answer
13 views

how do I map from a mapbox map or tile to the lat lon extents of the map?

A web app I use displays map tiles from mapbox and then uses leaflet to overlay that map with an svg path representing a route. The problem is that the area given to the map is very tiny, it's short ...
1
vote
0answers
34 views

Leaflet map with 'query of features' on mouseover and multiple layers

I have produced two working Leaflet maps that in total contain the features that I need for my application. However, I cannot solve how to have multiple 'overlay' layers that can be queried with ...
0
votes
1answer
579 views

Leaflet geoserver wms doesn't show on google map base layer

I have a site running Openlayers (base layer google and overlay wms in epsg4326 from geoserver). The site works fine. I've decided to try doing the same with leaflet , and from some reason I can't ...
2
votes
1answer
294 views

Draw heatmap only over water layer using Leaflet?

I need to draw a heatmap, but only over water because I want to represent water heat level. I am using Leaflet. How can I do it? I found an only-water layer, maybe it would be usefult for developing ...
1
vote
1answer
54 views

How to load html file with leaflet map using PyQGIS

I have simple .html file with leaflet map layers. I want to load these layers in QGIS mapCanvas with ability to choose one of the layers. How can I load this .html and show one of map layer with using ...
1
vote
1answer
209 views

CartoDB JSONP callback in leaflet-search plugin

long time reader, first time question-asker etc... So I'm trying to implement a search function on an app I'm building using data from cartodb in leaflet and this leaflet-search plugin: http://labs....
1
vote
1answer
572 views

Leaflet update getcenter coordinates

I am bringing in leaflet routing control into my map and I would like to have the route icons show up in the center of the current view. using the code below I can get the icons to show up at the ...
4
votes
2answers
5k views

How do I set the fillcolor of polygons in Leaflet.js dynamically?

I'm using the interactive chloropath example for leaflet.js I figured out how to make each of my polygons add a running tally of values to the bottom of the page after each polygon is clicked. Upon ...
1
vote
0answers
53 views

Can MapboxGL use nearest neighbour interpolation for overlay image? [closed]

In HTML+CSS version of mapbox/leaflet I can set image-rendering option for .leaflet-image-layer with CSS to choose interpolation method. How can I make this in GL renderer? UPD Solved You can set ...
2
votes
2answers
32 views

Can't continue scrolling on mobile devices when a map occupy all the screen

We have an issue on mobile which is the user can't keep scrolling if the there is a map on the page and it occupies the whole screen. Here is the code: // center of the map var center = [-33.8650, ...
1
vote
2answers
49 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 ...
0
votes
1answer
39 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 ...
2
votes
2answers
46 views

Leaflet filled contour map

I have evaluated the Getis-Ord Gi*-spatial statistic for each point in my map. Like this, each point is assigned a Gi-score and due to this a certain color, as you can see in the image below. What I ...
0
votes
1answer
39 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 ...
0
votes
1answer
28 views

Non-Earth maps, tile server and scale in leafletjs?

I am looking at putting together a tile server for other astral bodies, such as Mars and the moon. At the moment I am using leafletjs and the Control.Scale at the client end (though could be any ...
0
votes
1answer
130 views

Accessing GeoServer 2.8.0 on Debian 8 using Tomcat 8?

Not been able to access my Geoserver with Javascript. The Leaflet code running natively works in other javascript/HTML pages which connect on-line GIS servers. Added ENABLE_JSONP true to web.xml ...
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 ...
0
votes
3answers
291 views

Geocode free APi for internal application [closed]

I need opinions / experienced use on this issue: Which API can be used to geocode an internal application of a company that meets these requirements: Can be used for company internal application ...
3
votes
1answer
521 views

Leaflet custom div & click propagation on other elements

I've gotten custom HTML applied successfully within my #map element (where Leaflet is appended) but I'm having unusual behavior with other Leaflet objects that find themselves within the transparent ...
0
votes
1answer
22 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 ...