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

learn more… | top users | synonyms (1)

3
votes
0answers
70 views

Using Waze map tiles with Leaflet

I came across this Map Comparisons where they have used Waze map tiles. I searched around and couldn't find any official documentation for using Waze tiles in leaflet. I couldn't even find their ...
8
votes
1answer
2k views

Generating Interactive Tiles using Nodejs, Mapnik, and PostGIS for Leaflet

I am looking to do something like this but where I have all the data on the same server. I've been following through the set of tutorials @ sparkgeo.com/labs/big/ and I'm having some difficulty. ...
0
votes
1answer
59 views

How to filter polygons in Leaflet using range slider

I have a map I'm working on with Leaflet that displays a choropleth of zip code-level data. One piece of functionality I would like to add is to allow users to use a range slider to filter out ...
2
votes
1answer
476 views

JSONP working with Leaflet time slider

I would like to integrate the time slider into a JSONP geoserver. Here is the current code I have http://jsfiddle.net/qcwcrwge/26/ and I would like to use the time slider with a layer called ...
0
votes
0answers
43 views

gdal2tiles: how to make filenames of tiles to represent xyz coordinates?

I'm converting ECW file to tiles using gdal2tiles. Right now the tiles and folders generated by gdal2tiles are named as numbers starting from 0 successively. The folder structure looks like: How to ...
1
vote
2answers
50 views

leaflet / change a geojson divicon html

I have a geojson layer with a divIcon and now i want to change it. i have tried whit seticon but it does not work. How could i do it? This is what I am trying: papesjson.eachLayer(function(layer){ ...
1
vote
1answer
183 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
46 views

XY bounds for L.tileLayer in CRS.Simple

Sorry for my english Hi, I have leaflet.js (image of map 5913x7863) and there L.CRS.Simple I had var imageBounds = [[1468.9700,-11.7050], [1968.2705,363.7705]]; var file0 = new ...
1
vote
4answers
59 views

Does Google Maps API or OSM provide location/place boundaries

I've been digging around today in Google Maps and Leaflet API's to find if there is an easy way to get these boundaries instead of needing our users to manually outline these things (like drawing ...
0
votes
1answer
21 views

mapbox geojson + leaflet + custom markers

In the geojson file the following can be found for a marker (coming from mapbox geojson) "marker-color":"#1087bf","marker-symbol":"monument"} I would like to find a solution so monument will be ...
2
votes
3answers
276 views

Prevent Leaflet from requesting non-existing custom tiles

I have created custom tiles using TileMill. extracted tiles as png images and adding them on base layer. using following code var venu_map = new L.tileLayer('static/b18/{z}/{x}/{y}.png', { ...
3
votes
1answer
46 views

Leaflet + GeoJson = problem with style

I got my first leaflet + geojson project partly working! (even the popup with content from the geojson file!) but I still have a problem with style the geojson (export from mapbox) file has point, ...
0
votes
1answer
351 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
461 views

How to export to all points within Leaflet polygon?

Is it possible to export all points within a polygon drawn using Leaflet? (http://leaflet.github.io/Leaflet.draw/).
0
votes
1answer
269 views

Reset Leaflet map

I'm creating a map like this: var map_object = new L.Map('map', { center: [39.8282, -98.5795], zoom: 5, }); var sublayers = []; ...
0
votes
0answers
13 views

Gis2web - QGIS plugin troubles

I have QGIS 2.6.1 and when I want to get some results using gis2web (by Tom Chadwin) plugin, in fact, to get a webmap in OpenLayers, it seems that plugin doesn't work properly. E.g. I have a point ...
2
votes
1answer
86 views

Custom HTML Within Leaflet Map

We're upgrading our Leaflet maps to be larger on the screen and doing so in part by putting information panels, etc. over the map with varying transparencies. Obviously this is easy to do by ...
1
vote
1answer
202 views

how to draw a polygon in leaflet and add it to geojson file

I am working on a small project with leaflet. the goal of the project is to show a geojson file and updating it dynamicaly from the window of the web site. I have imported the geojson file to the map. ...
1
vote
3answers
46 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
0answers
19 views

redraw canvas when add new overlay?

Good day! A little problem: how to redraw canvas when I add overlay layer? Firstly load osm map, then creates canvas. So when I push the botton and add another layer it looks like sandwich and canvas ...
1
vote
1answer
32 views

Leaflet map isn't loading in the correct location

I'm currently working with Leaflet and a dockable web framework called Golden Layout. I'm trying to load tiles into the map, but they are not loading properly and I'm not sure why. Currently, I have ...
3
votes
1answer
542 views

How to get data from TileMill tileLayer properties in Mapbox for click/hover

I've successfully used Leaflet to load a geoJSON polygon-shapefile with data, and added click and hover interactivity to the layer. For a large dataset, I switched to mapbox.js 1.6.1, used TileMill to ...
3
votes
3answers
1k views

'Home' button leaflet map

is there a possibility to have a kind of home button on my map which will zoom to my initial map view or a specific defined position, resp.? Any help welcome! Thanks
1
vote
0answers
32 views

dynamic legend for tiles in Leaflet

Good day dear professionals! I have a little problem. I started to learn javascript and leaflet not so much time ago, and now I can work with layers, but creating controls that I need is to hard for ...
0
votes
1answer
50 views

Have to click twice to open popup leaflet

I am trying to make a map in which a marker can be clicked and a popup opens up with some information. I have successfully done all of that however my first click on any of the markers result in the ...
0
votes
0answers
11 views

How to show busy icon when leaflet api load tile images RSS

i like to know is there any way exist in leaflet api which i can fire when it load tile and when tile loading finish then another function will be called. i was reading leaflet api and found in this ...
1
vote
1answer
19 views

Leaflet js : text is not showing on map

here is my jsfiddle link http://jsfiddle.net/tridip/5abu963o/. i made provision so a yellow color text should be lying on map but not working. here is the js part only i like to highlight. $( ...
2
votes
1answer
135 views

How could I generate a CRS field inside the GeoJSON object created by Leaflet layer.toGeoJSON?

I'm using Leaflet to transform some drawn polygons to GeoJSON and send them to a backend. But the GeoJSON objects generated by layer.toGeoJSON are like this: { "type":"Feature", "properties":{}, ...
0
votes
1answer
207 views

Leaflet.js map - Pan too and Zoom in on point

This is the first time I am using Leaflet.js. I am trying to create a story map but have come across an issue. Currently I have a map with a scrolling text bar on the left hand side. I would like ...
1
vote
2answers
359 views

Load or display differents geojson data on zoom level for leaflet maps

I have a map with 3 levels of information. The first is the country, the second the state and the last one the cities. I wonder know if it's possible to use the zoom value in order to display the ...
1
vote
1answer
399 views

How to add multiple cartodb layers in viz.json to a leaflet layer control

I have create a visualisation in cartodb with 4 layers. The resulting viz.json is added to a leaflet map as follows: cartodb.createLayer(cartomap, [url], {https:true}) ...
0
votes
1answer
34 views

Getting GeoJSON formatted properly for Leaflet?

I am trying to get data put on a leaflet map that I have set up. I am following this tutorial: https://www.youtube.com/watch?v=fDfkjx-VhLI I have all of the html, css and js scripts up and running, ...
0
votes
1answer
203 views

Leaflet: how can I update content of popup by jQuery

in my popup is a spinner with class=spinner and an empty container for addon informations. I want to hide after successful ajax. I want to add some html in a container. I tried this: ~~~ ...
2
votes
0answers
42 views

GTA V coordinates to LatLng

I'm here because I'm trying to create a GTA V map with Leafletjs API. In deed, I've got my tiles that are ready. But the aim is to put markers on the map by using GTA V in-game coordinates. To achieve ...
4
votes
2answers
79 views

Big data sets and challenges using the Leaflet client

I am using Leaflet to present around 90.000 data points. My test code is generated using the plugin QGIS2leaf in QGIS 10.10.1. I am using clustering and reviewing the code I can see that this is ...
6
votes
1answer
254 views

Moving a shape around the earth while maintaining the proper projection

What is the transformation needed to be taken on every data point of a shape to rotate that shape around the globe. I'm trying to figure out the math behind this kind of transformation so I can ...
7
votes
2answers
5k views

Auto zoom on multipolygon with leaflet

I have a geojson with a multipolygon and I want to fit this multipolygon to the map. The map center only on one polygon not on the multipolygon. Here is my script var map = L.map('map',{ ...
1
vote
1answer
840 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
2answers
50 views

How do I toggle (add/remove) shapefile layers in Leaflet.js?

If I create a shapefile layer var ac_shpfile = new L.Shapefile("data/AC.zip", {onEachFeature: function (feature, layer) { /* Add some colors based on shapefile features */ }}); and then add it to ...
3
votes
1answer
231 views

Leaflet change color dynamically

I am new with leaflet and I need help to change the color of a polygon on a choropleth map dynamically. In my website I have an slider, and depending on the position of the handle, the colors of the ...
0
votes
0answers
44 views

Rendering OpenStreetMaps with GeoServer

My target is to have the whole planet to be available in the map client[leaflet.js/openlayers.js] but only a specific country loaded with roads etc. I have followed the steps below to setup my ...
6
votes
3answers
17k views

How to draw a polyline in Leaflet?

This is my coding I used in Leaflet: var pointA = new L.LatLng(28.635308, 77.22496); var pointB = new L.LatLng(28.984461, 77.70641); var pointList = [pointA, pointB]; var ...
0
votes
0answers
43 views

Click event on anchor tag does not update Leaflet map as expected

I'm having problems updating a Leaflet map from a click event on an anchor tag located within a Leaflet Control on the map. Chrome and Firefox on Mac seem to have identical problems, Safari is ...
0
votes
1answer
35 views

What causes the Leaflet JS Providers error; Uncaught Error: No value provided for variable {time}

I am using leaflet providers and attempting to add the NASAGIBS.ViirsEarthAtNight2012 to my layer control, my other basemaps load fine; but this one doesn't and returns the following errors in the ...
0
votes
0answers
33 views

Problem visualizing OSM's ways twice in leaflet

I have retrieving all types of data from a small B-box using the Overpass Api and i have populated Postgres(postGis) using "osm2pgsql" with the default style. I can extract the ways into geoJson ...
1
vote
1answer
349 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 ...
1
vote
1answer
32 views

Controlling map details shown using Leaflet and MapBox

I am building a map based chart using Leaflet (with MapBox). I would like to know if there is a way to control the level of details displayed on the map when zooming in. For example I do not want to ...
2
votes
1answer
256 views

Is it possible to use two layer.bindPopup functions in Leaflet

I have two different layers in a leaflet map. I have one layer in which I would like the popup to return some text from the layer's attributes. They other layer I would like the popup to return an ...
0
votes
1answer
34 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
vote
1answer
307 views

Adding comments using leaflet draw

I am working on an application that will leverage the leaflet draw plugin so that a user can open my map and drop comments in the form of markers. Then the user can click submit and it will serve me ...