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

learn more… | top users | synonyms

2
votes
2answers
3k views

How do I overlay a KML on leaflet 0.4.4

I am using Leaflet 0.4.4, I have a KML I would like to overlay on the map, how do I go about doing this? Edit: I am already aware of https://github.com/CloudMade/Leaflet/issues/14, which directs ...
2
votes
2answers
635 views

Leaflet, defining a specific region for a canvas to draw upon

Using leaflet, you can draw on a given map by adding a Canvas layer. Some instructions are given here, http://leaflet.cloudmade.com/reference.html#tilelayer-canvas var canvasTiles = new ...
2
votes
0answers
56 views

Large loads geojson from mysql to leaflet?

I have a mysql database with +25K rows including geometry and other attributes. Using a mysql2geojson php script I then added it to a leaflet map. It is super slow now, what can I do to boost the ...
2
votes
0answers
18 views

How does one use leaflet layergroups with CartoDB layers?

I'm trying to use leaflet layergroups with a cartodb layer, ala: http://leafletjs.com/reference.html#layergroup but haven't been able to successfully do it. This is what I have so far: var map = ...
2
votes
1answer
27 views

Integrate Leaflet map into PDF

I am current in the process of writing a thesis. Being in the field of GIS it obviously involves some maps ;). While the whole world switched to interactive online maps, Universities still require to ...
2
votes
0answers
33 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
131 views

How can a leaflet SVG overlay be placed outside of the leaflet-overlay-pane?

I have SVG on top of GeoJSON in my map. How can a leaflet SVG overlay be placed outside of the leaflet-overlay-pane while keeping GeoJSON in place in the leaflet-overlay-pane? (For example, how could ...
2
votes
0answers
70 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": ...
2
votes
1answer
54 views

Why aren't my basemap tiles showing up via ArcGIS Server

I have a leaflet js script referencing the ArcGIS server imagery api. The code worked fine up until about two days ago. Now when I click on the layer there's a gray background. I am using my local ...
2
votes
0answers
88 views

Leaflet wms offset on zoom out

I have Leaflet map with base layer (epsg4326) and wms layer of gps point (also epsg4326). I've noticed when I zoom out , the gps point offset to the left. Any idea why it happens ? Here you can see ...
2
votes
0answers
202 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 ...
2
votes
0answers
153 views

Does SVG offer better performance than plain HTML to render text labels in Leaflet? [closed]

I'm using Leaflet built-in L.DivIcon to add text labels to my map. Text labels are rendered in simple HTML divs and can be rotated and scaled using CSS based on values obtained from geojson data ...
2
votes
0answers
170 views

Data visualization techniques for web maps using ESRI and open source suits

I want to represent statistical data over the web map and looking the examples/techniques to represent data on the web map (apart from Pie-chat, bar graph) with new tools like gauge widget etc. ...
2
votes
0answers
34 views

Protect our WMS map tiles to only accessible from our site [duplicate]

We are using geoserver (2.3) to serve WMS map tiles generated from mapping data we licenced. We use leaflet on the client side to show the map (part of a ruby on rails site running on heroku). Because ...
2
votes
0answers
137 views

Show geoJSON properties in jQuery Mobile Panel

First off I'm a novice at JS so please bear with me if this is a simple task to complete. I'm currently using the stock LeafletJS popup bubble to display the properties from my geoJSON. However, I ...
2
votes
1answer
195 views

leaflet geojson contextmenu

I want to add a context menu on right click for various elements on my geojson layer (I'm doing a road map so on a right click on the road at any part I want to show the context menu). I've managed ...
2
votes
0answers
595 views

Projecting point in Leaflet from EPSG 900913 (same as 3857) to EPSG 2232 with proj4js returning unexpected results

I have a leaflet map from which I want to be able to query an api that accepts x y values in EPSG 2232 as inputs. Leaflet doesn't handle point transformations like Open Layers does so I am trying to ...
2
votes
1answer
472 views

How to render points from CartoDB with Leaflet and Leaflet Vector Layers?

I have a table in CartoDB containing some points. I want to render these points dynamically with Leaflet. There is cartodb.js for such tasks, but it does not support full customization of Tooltips, as ...
2
votes
1answer
402 views

How to keep bound popups from opening on [click]?

I am working on a map application which creates and binds popups on markers and polyline objects. The popups are created and bound lazily, i.e. ad-hoc when a user clicks on a specific object. The ...
2
votes
0answers
545 views

Problem with multipolygon in Leaflet

I'm using Leaflet L.Polygon, but for some reason there's only blank site. Here's my code: var map = L.map('map').setView([37.8, -96], 4); var cloudmade = ...
2
votes
0answers
883 views

Overlaying a mbtiles tile layer produced with tilemill over another layer maintaining transperency

So using leaflet, I'm overlaying my base tile layer as google satellite imagery. I want to overlay another layer (Mbtiles layer) produced with tilemill over this satellite layer. I was successful in ...
1
vote
1answer
590 views

How to get correct format of coordinates for export to geojson from QGIS?

I've created a custom map in QGIS with a few shapefiles. I'm using leaflet.js to render the map and the shapefile points and everything lines up correctly. The CRS is set to 4326. When I export the ...
1
vote
2answers
699 views

Does Leaflet has option for scale dependent layers?

Is it possible to show layers with Leaflet depending on scaling? For example not show counties until zoom level reaches 10. Thanks.
1
vote
3answers
6k views

How to get the Lat, Long of a clicked location using Leaflet API?

I am using OSM with leaflet API. Now i want to get the lat and long of a clicked location. I meant something similar to this. ex: http://openlayers.org/dev/examples/click.html ...
1
vote
2answers
161 views

qgis, simplify parcels to share borders

Is there a QGIS plugin or other method that simplifies parcels to share a common line(border)? I'm pretty sure I read about this some time ago. Couldn't find anything here or elsewhere. I'd like to ...
1
vote
2answers
2k views

How to open popup menu on right click in Leaflet

I want to open a popup menu list on right click with Leaflet map. I have tried the ContextMenu of leaflet but couldn't do it. Here is the sort of code I used. map.on('contextmenu', L.popup() ...
1
vote
1answer
3k views

location of a dragged and dropped marker using leaflet

I am using the leaflet API with OSM. I need to implement a functionality where on dragging the marker and dropping it on user preferred location, I need to get its latitude and longitude and save its ...
1
vote
2answers
55 views

How to load big geo-data file into web application

I am building a web app where I show details in map. I load data using geojson file (190 mb). I was looking in different possibilities to show the data, here there are: Leaflet GeoJSon: it should ...
1
vote
1answer
125 views

Leaflet.geojson webpage performance out of hand, how to convert to .png?

I exported some countries as a single .geojson file. The file includes every country's vertices and coordinates, as that's what a .geojson is ─ a vector file. Thing is, there are about 20 countries ...
1
vote
1answer
134 views

How to improve speed of rendering polygons from Postgis in Leaflet?

I want to improve speed of rendering polygons in my Leaflet map. Polygons are stored in Postgis, and are rendered with select query with bbox. I wonder can I cache somehow those polygons? I read ...
1
vote
2answers
2k views

How to add text-only labels on Leaflet map with no icon

I'm looking for a way to show text on Leaflet map using markers or anything else without showing any icon. I want to show text only and be able to style and rotate it... Any suggestion? Thanks a lot ...
1
vote
2answers
229 views

Leaflet: maximum number of layers?

Is there a limit to have many layers you can have in a leaflet map?
1
vote
1answer
1k 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.
1
vote
1answer
2k views

Syling Leaflet Maps

Is there anyway to style base maps using Leaflet? I know there are quite a few options for loading different pre-made styles (such as Stamen, Mapbox, etc...), but I am looking for a way to create my ...
1
vote
1answer
56 views

Reprojecting in postGIS from 900913 to 4326. Wrong coordinates

I'm working with postGIS 2.1 I have a table called 'xacementos' created with the srid: 900913. I took the points coordinates from google maps and I want to convert them to SRID:4326 to show the points ...
1
vote
2answers
167 views

Is it possible to convert regular JSON to GeoJSON?

My apologies if this is a repeat question, I searched here and couldn't find an answer. I have JSON data I've exported from Openpaths.cc which contains lat and lon values. However, the data is not in ...
1
vote
1answer
84 views

Gdal2tiles with tif projection failure

I downloaded this .tif image of the world (small version) from Natureal Earth and tried to convert it to tiles using Gdal2tiles in OSGeo4W. In the terminal, I used the following commmand: gdal2tiles ...
1
vote
2answers
530 views

gdal2tiles.py generates wrong tiles / MapTiler the right ones

I'm trying to generate tiles with gdal2tiles.py and the resulting tiles are stored as 18/132639/164219. If I do the same thing with MapTiler (the GUI variant of gdal2tiles) the tile result is ...
1
vote
1answer
76 views

Removing Places from OSM

Doe is exists a way to remove all the places from the OSM map? Also like shops, bars, restorations, hotels etc. I wish to use a maps with a less info. Is it possible to do this from the original OSM ...
1
vote
1answer
166 views

How to prevent data scraping in a web map?

I would like to use Leaflet or a Leaflet-like mobile-friendly library to produce a web map of points of interest, but I am concerned with how easy it is to just scrape the data from the javascript. Is ...
1
vote
1answer
256 views

Reprojecting coordinates and geoJSON in leaflet

I have a Leaflet map in default projection and a wms layer also in default (web mercator) projection. I would like to add polylines and a geoJSON layer to my map, but the coordinates are in EPSG4326. ...
1
vote
1answer
394 views

create polylines with different colors in leaflet

I have one function which creates poly line & adds that polyline to map function makeRoute(e) { if(pointsSelection.length > 0) { pointsSelection.push(e.target.getLatLng()); ...
1
vote
2answers
471 views

How to use Leaflet marker clustering with image map only?

I have image map of one state, where I would like to put about 100 markers. Is it possible to use only one image map instead of CloudMade tiles Leaflet usually uses? So, I need only that image to be ...
1
vote
2answers
1k views

leaflet and geojson tiles

New to mapping. Trying to create a heat map with data that updates every hour for US Counties with leaflet.js similar to http://leaflet.cloudmade.com/examples/choropleth-example.html. But, adding ...
1
vote
1answer
169 views

Unable to get Mapbox leaflet-omnivore to load markers from .csv

I'm using the Mapbox.js API to build a really simple web map using a .csv file to place markers with tooltips. I'm trying to use the suggested leaflet-omnivore library to easily parse the csv and ...
1
vote
1answer
112 views

How can I load stricly tiles within the current viewport in Leaflet.js?

I have tiles that are not available for the whole map. How can I stop Leaflet.js/Mapbox.js from making requests to these tiles? There are dozens of 404's that I'd really like to get rid of. Thank ...
1
vote
1answer
50 views

Hot 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":{}, ...
1
vote
1answer
391 views

Leaflet draggable Marker

I have setup a draggable marker on my map with Leaflet API. Its working fine. But the problem is when I am trying to drag it to the border area the map is not moving. I want a panning map with Marker ...
1
vote
1answer
1k views

setStyle() function for GeoJSON features - Leaflet

Ok, since I already asked a very long question about this, but since it didn't get any new replies for a while, and not to get confused in details, I will keep this one simple the best way I can. If ...
1
vote
1answer
706 views

Leaflet Heatmap Dynamic data layer

I am trying to add heatmap layer to my map. I have tried the following plugin: http://www.patrick-wied.at/static/heatmapjs/example-heatmap-leaflet.html From this plugin the data came from ...