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

learn more… | top users | synonyms

5
votes
1answer
4k views

How to open popup on mouseover in Leaflet? [duplicate]

Possible Duplicate: How to show a popup on mouse-over, not on click? I'm working with Leaflet library. I defined L.layerGroup and add some markers to the group. Can somebody help me with ...
5
votes
2answers
142 views

Leaflet: How to enable pan & zoom while GeoJSON still rendering?

I've overlaid a huge GeoJSON geometry on top of my Leaflet map, covering about 20 countries' borderlines (about 1,5 million vertices) using "L.geoJson". Each time I zoom in/out, the computer has to ...
5
votes
1answer
879 views

Is it possible to create filters based on attributes for markers in Leaflet?

I need to create filters based on attributes of markers. I have markers defined this way: var locations = [ ['AB11 5HW','17','A',57.147701,-2.085442 ] , ['AB11 8DG','3','B',57.129372,-2.090916 ] ...
5
votes
2answers
215 views

How to download Leaflet vectors in GPX format?

I would like to use the leaflet.draw plugin to allow users to digitize vectors on the map. At the end the data should be downloadable as a GPX-file. Is there any sample that shows how this can be ...
5
votes
1answer
184 views

How to handle the New ESRI Ocean Basemap

Some of you may have seen this recent (4/28/14) ESRI blogpost - The New Ocean Basemap. ESRI, in their infinite wisdom, has split up their Ocean Basemap into 2 separate services. One with just the ...
5
votes
2answers
196 views

Simplest way to make web maps with lots of shapes

I have some computed data about US Census blocks. I'd like to make a web map to display that data. I've searched around and found various tools, but I can't tell what is the simplest "lazy man's ...
5
votes
1answer
2k views

Leaflet and EPSG 4326 Projections

UPDATE: LEAFLET fixed support for EPSG 4326 (LL84) in the latest betas: https://github.com/Leaflet/Leaflet/issues/1207 Leaflet says it supports EPSG 4326 (Plate Carree, aka ll84) projections. I think ...
5
votes
1answer
793 views

Working examples of Leaflet/Polymaps with GeoJSON tiles generated from Tilestache using Shapefiles?

I'm looking to create choropleths using GeoJSON tiles generated from ESRI Shapefiles by TileStache(or similar), in either Leaflet or Polymaps. So far reading and drawing GeoJSON from both Leaflet and ...
5
votes
0answers
72 views

How to add an attribution on a GeoJSON Layer from Leaflet?

I need to use a GeoJSON Layer on my Leaflet map. Here is a sample of my code: function onEachFeature(feature, layer) { if (feature.properties && ...
5
votes
1answer
77 views

Need Advice - Displaying very large amounts of data on Leaflet js from database

I'm researching the best way to display a very large weather dataset (850mb +/-) for folks to use on their mobile and desktop devices. This huge dataset (1 point every 12km across the USA) that I'd ...
5
votes
1answer
150 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 ...
5
votes
1answer
592 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. ...
4
votes
1answer
1k 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.
4
votes
1answer
81 views

Why do these points send me to the middle of the ocean or middle of nowhere? [duplicate]

I've been beating my head against the wall trying to map some points using Leaflet + OSM. I put in some sample points (near Bellingham, WA, USA). I've checked the JSON with JSfiddle and ...
4
votes
5answers
1k views

How to get a Leaflet app with a big GeoJSON file to work on mobile devices?

I have a leaflet app which displays a GeoJSON file as a layer. It works fine in the web browser. On the mobile browser it starts up, but quits after panning around on the map. I think the reason for ...
4
votes
1answer
2k views

leaflet geojson coordinate problem

I just started to play with leflet/geojson a little. But my coordinates are not rendered properly and I have no clue what is going on. My coordinates are: 52.23943, 4.97599. They work correct with ...
4
votes
3answers
3k views

MySQL to GeoJSON - Formatting Issue

I'm trying to make a select on a mysql table and then write it out to a geojson file. I'm getting close but there are a few issues. Here's what I have so far: <?php require("dbinfo.php"); // ...
4
votes
2answers
523 views

LeafletJS: Load Tile Layer based on bounding box

I have a LeafletJS map application with lots of layers. I have a few layers that only have imagery for certain regions across the world. Because everything goes on a world base map. All tile caches ...
4
votes
1answer
2k views

Offline SLIPPY Map (Tiles) Database for Leaflet

How can create an offline cache of a large number of SLIPPY tile (PNG, 256x256) inside a web browser and then display them from that offline cache. For example, can one use HTML5 IndexedDB as an ...
4
votes
3answers
5k views

Custom Leaflet Controls

I have gotton some help in creating a custom control for leaflet, but I am still having trouble upgrading to the CSS styles used by the latest versions of Leaflet. Basically, all I need is a icon in ...
4
votes
1answer
127 views

*Leaflet* mouse wheel zoom only after click on map

I'm working with the Leaflet JavaScript Library and attached a (working) map to my HTML Document. It is in the middle of the page, and when I'm scrolling down with my mouse wheel and arrive at the ...
4
votes
1answer
385 views

What is the best practice to show GPS movements on map (Openlayers or Leaflet) using DB and Geoserver?

I have GPS unit which update the DB with Points every 10 seconds. I want to show the position in real time (as much as I can) on map using OL or Leaflet. What I did is serving the Point as Layer in ...
4
votes
1answer
505 views

Existing ArcGIS Rest Services - What platform to use for building mapping application?

I have clients that have an existing ArcGIS Server. Map layers are published as rest services and I am going to build a mapping application that displays their datasets. Functionality should include ...
4
votes
2answers
2k views

Leaflet drop markers animation

Is it possible to do drop markers on the map like in google maps (https://google-developers.appspot.com/maps/documentation/javascript/examples/marker-animations-iteration) in leaflet
4
votes
2answers
45 views

Visualization of a field in Leaflet

In a Leaflet app I want to overlay raster data (technically speaking, a field) on a web map. The data consists of triples < lat,lon,value >, where value is in range [0,1], for example: ...
4
votes
1answer
122 views

Show markers only at certain zoom levels

I'm building a cycle touring map in leaflet.js, with subjective information overlaid as markers, along the lines of "this is a great road", "this town is quite nice" etc. To avoid information ...
4
votes
3answers
631 views

Create buffer around point in LeafletJS?

I am using LeafletJS. I want to create buffer around point. after Selecting a point buffer radius will be specifed by user in feet. After searching of awhile I found this link of JSTS. does JSTS ...
4
votes
1answer
63 views

Leaflet: how to change default style on a point GeoJSON Layer?

I need to change style on a point GeoJSON layer in a Leaflet map. I'm using the following code: function onEachFeature(feature, layer) { if (feature.properties && ...
4
votes
1answer
94 views

How can I create drawFeature control in leaflet?

I want to call a callback on leaflet after drawing a feature. In openlayers I do it like this : customControl= new OpenLayers.Control.DrawFeature( tempLayer, ...
4
votes
1answer
2k views

How do I add my own map layers to Leaflet

I have a Leaflet map and want to add two of my own small polygon layers (currently in shapefile format, but they could be converted to GeoJSON). Can this be done without a mapserver to publish them ...
4
votes
2answers
2k views

Click link inside Leaflet Popup and do javascript

I have a leaflet map up and running. It overlays a series of polygons (via GeoJSON) on the map and attaches popups to each polygon. Each of the popups display information about that polygon. I'd ...
4
votes
1answer
3k views

Leaflet marker cluster and popups

I want to develop a map with Leaflet marker cluster. You can see how it looks like here: https://github.com/danzel/Leaflet.markercluster But I need that my markers have popups with more information ...
4
votes
2answers
199 views

Editing PostGIS topology in a web browser

I am trying to conceptualize the best process for editing topology from PostGIS in a web browser. Ideally what I would like to accomplish is the loading of a topology (imagine the lower 48 states of ...
4
votes
2answers
609 views

binding nested arrays as geojson popups in leaflet

I am struggling with geojson popups in leaflet.js I have nested arrays as properties for my features - an example would be counts of fish caught at a location (not my actual project data!) ...
4
votes
1answer
3k 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',{ ...
4
votes
1answer
2k views

How to add a geoJSON layer to leaflet map?

i am newbie in leaflet & its geojson features... I am trying to test leaflet's functionalities. In fact i have built a map and its layer: var map = new L.map('map', {scrollWheelZoom:true, ...
4
votes
2answers
82 views

Plot a Raster of Weather data in Leaflet JavaScript Map without generating server-side tiles?

I want to show different weather data I have as binary arrays on a server using leaflet. But I do not want to generate tiles on the server. For each point in an a array I have the coordinates in ...
4
votes
0answers
40 views

Does leaflet.js offer an gutter option just like Openlayers

Currently we are switching from Openlayers to leaflet.js and there is a problem using a WMS layer with leaflet. The WMS being used is Deegree. When a layer is visualised within leaflet there are ...
4
votes
0answers
145 views

GeoJSON shape distorted on Leaflet.js spherical mercator WMS map [closed]

I have a map with a simple WMS layer in spherical mercator projection (rendered by a OSM-Mapnik-TileCache server stack, everything is in EPSG:900913 / EPSG:3857). First: I can't understand why, if ...
3
votes
2answers
56 views

Merge geojson polygons with WGS84 coordinate

I have a Geojson file with some adjacent polygons and I want to merge them into one. I know it's a recurrent question but I can't find information for polygons with latitude and longitude coordinates ...
3
votes
3answers
4k 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 ...
3
votes
3answers
163 views

Offline Map Service with Mapnik and Leaflet

I'm relatively new to GIS, so I hope my asking doesn't appear to be ignorant in any way. I currently work on an offline map service solution for usage in areas without internet connection. For that ...
3
votes
3answers
336 views

Is it possible to check incoming GeoJSON to see if any of the features are identical to existing ones before adding to map?

I am working on a Rails/PostGIS app and doing a typical ajax call to retrieve GeoJSON within the map viewport bounds. Whenever the map is shifted or zoomed all of the markers are removed and then ...
3
votes
3answers
1k views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
3
votes
2answers
127 views

Convert data to another Coordinate Reference System

Assuming I've a point like this : POINT (751318 9760879) This point is in EPSG:27700 coordinate reference system. How do I convert the point to display in a map with EPSG3857 coordinate ...
3
votes
3answers
323 views

Leaflet and ArcGIS Geoprocessing Service

Does anyone know of an example of a leaflet map with a geoprocessing service? Is it possible? What would the code look like? I know ESRI Leaflet allows feature layers and map layers but I can't find ...
3
votes
2answers
506 views

GeoJSON formatting for Leaflet

I am using http://GeoJSON.io as the source for my data, which is then to be displayed via Leaflet.js. I found that leaflet neads the file to include "var name = {" but GeoJSON.io doesn't like it, ...
3
votes
4answers
1k views

Display GeoJSON layer on top a SVG image instead of a map.

I'm very new to GIS, so hope this is the correct place to ask. Not sure if this will even be possible. This is what I want to achieve: In short, I want to display a set of polygons, lines etc. in a ...
3
votes
2answers
417 views

Slippy map format

When do you decide which to use? I've started using Geoserver and it seems like map files are downloaded to the browser (using Leaflet) in the WFS format. When I look at OSM, Mapbox etc, they use ...
3
votes
1answer
766 views

How to avoid corrupt geometries when translating between TopoJSON and GeoJSON?

I'm trying to display some geojson vector features on a leaflet map. The size of my GeoJSON is too big (25.4mb of data, 8.47mb gzipped), so I'm trying to use a TopoJSON format to reduce the size ...