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

learn more… | top users | synonyms

0
votes
2answers
394 views

How do I modify features during runtime, in a GeoJSON feature group on Leaflet?

I have added some GeoJSON to my Leaflet powered map as below. (Altered version) var array_of_layers = L.layerGroup([]); var styleholder = []; var belgium_style = {color: "#d3e46f"}; var bosnia_style ...
3
votes
2answers
700 views

Leaflet offline tiles problem

I hate to ask this kind of questions, but i ve been stuck for 2 days now: I rendered some tiles with mapnik which i want to serve in my offline application which will run from a portable disk, but ...
0
votes
1answer
156 views

TypeError in leaflet on zoom in or out

I am working on an application that renders land parcels from PostGIS as polygons in Leaflet. I have an event handler set for 'viewreset' on the map: this.leaflet_map.on('viewreset', ...
0
votes
0answers
26 views

Changing basemaps from cartodb.js

Is there a good way to change leaflet basemaps from cartodb.js or leaflet.js? I am able to grab the map object and basemap layer from the layers property in the done() promise. ...
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 ...
1
vote
1answer
153 views

passing geocode results object to another file

I'm using a geocoding plugin (Leafet.GeoSearch) on a map and I'd like the results, being the LatLng point coordinates, etc available as a parameter for GeoServer cql filtered calls. It doesn't seem ...
0
votes
0answers
29 views

Leaflet + proj4js + EPSG:2180

I'm trying to add a WMS layer in EPSG:2180. I get the definition for EPSG:2180 from here and I am using this guide on GitHub to make a new CRS definition, but I think it is corrupted. It is not ...
13
votes
5answers
741 views

Comparing two maps with nice web interface?

Is it possible in Leaflet or OpenLayers to compare two maps with a bar to slide between the two? Examples include: ...
1
vote
2answers
192 views

How I can load tileLayer in Leaflet framework using local tiles?

I'm using file:///C:/path/tiles/{z}/{x}/{y}.png like url of tileLayer but it doesn't work and no error is shown. var layer = new L.tileLayer("file:///C:/OSM/tiles/{z}/{x}/{y}.png", { minZoom: ...
3
votes
2answers
383 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 ...
1
vote
1answer
336 views

Leaflet: Container coordinates vs Layer coordinates?

What is the difference between map container coordinates and layer coordinates? From what I gathered, the map container coordinates are always relative to the map viewport, and while layer ...
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 ...
1
vote
2answers
261 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 ...
2
votes
2answers
1k views

Animated lines and line styles in Javascript

I'm using Leaflet library and Mapbox. I need to create animated line from one city to another, slow motion "travelling" from one point to another point. Is that possible in javascript and how? I can ...
0
votes
0answers
11 views

change content div on layergroup change

I have two layers in a LayerGroup that I can toggle between and would like to update a control(bottom left in example) with the grades of the currently selected layer. How can I go about doing this in ...
0
votes
1answer
22 views

Using LeafletJS, how can I identify which layers are currently displayed on the map?

While attempting to save the current state of a leaflet map in local storage, I've not found a way to detect which layers are currently active (which basemap is currently in view and which overlays ...
1
vote
1answer
218 views

proj.4 definition for Moscow GCS_Bessel_1841 to WGS84 convertion

I'm developing an app which should show a map using Leaflet framework but i have no luck as the coordinate system on the map server differs from the one used by Leaflet. As a map server i use ...
0
votes
2answers
227 views

Can leaflet read OSM xml format?

I want something similar to OpenLayers.Format.OSM for leaflet. i know how to use a geojson file and i have found support for GPX and WFS in plugins, but not for OSM. Simply saying i want to make this ...
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
3answers
708 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
0answers
61 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 ...
0
votes
1answer
13 views

OpenLayers/Leaflet render world borders

I am trying to show all world borders. Either using OpenLayers or Leaflet. World borders are taken from here. This code does not work. What I am doing wrong? var Map = { map: null, layer: null, ...
1
vote
0answers
36 views

Leaflet add and remove legends with layer selection

I'm new to Leaflet/Javascript and have been struggling to get legends a map to show only when a specific layer is selected from the layer control. I have three layers, one of which I would like to ...
1
vote
2answers
530 views

How to project pixel coordinates in leaflet?

I am trying to create a map based on an image which is 16384x16384 px, but I would also like to add markers at specific locations using pixel coordinates of this given image. I created a tile layer, ...
1
vote
0answers
28 views

Leaflet marker cluster by Administrative boundary

Is it possible to perform clustering based on administrative boundary using the leaflet.markercluster plugin? How would I do that? I already have the boundary layer.
0
votes
0answers
13 views

Geoserver WPS - Tiled Barnes Surface with geospatial index

I'm using Barnes Surface to compute a set of points from my PostgreSQL db. The problem is that my whole table is processed for each tile. I added a geospatial index on my points, how can I tell ...
1
vote
0answers
8 views

Opacity contrl for mapbox map with several layers

This is an example of how opacity can be changed for a Mapbox.JS map: https://www.mapbox.com/mapbox.js/example/v1.0.0/opacity/ The example shows only one layer used. With barely any experience in ...
1
vote
1answer
103 views

Leaflet setView with non lat/long CRS

Is it possible to use setView when using an alternative CRS? var map = L.map('map',{crs: L.CRS.EPSG26915}).setView([4970081,477018], 13); // Returns: Uncaught TypeError: Cannot call method ...
0
votes
0answers
33 views

Looking for mobile web app map control that can handle layer redraw with good performance

I want to develop mobile web app to track GPS coords in real time (refresh every 10 seconds) from geoserver. Currently I have desktop site I wrote in ExtJS 4 and it works pretty well (Openlayers + ...
0
votes
0answers
19 views

drag and drop csv file and display map using leaflet js

I am new in php and leaflet js. I want to drag and drop .csv file in php and using the values of csv file, I want to display map using leaflet js. Can any one help me.
0
votes
1answer
68 views

Add EPSG:3857 geometries to map using Leaflet

Right now Leaflet can only add geometries with latitude and longitude values onto the map. If we have a EPSG:3857 point, whose x=-11819829 and y=4200860, how can I add it onto the map? If this point ...
4
votes
5answers
665 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 ...
2
votes
1answer
26 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 ...
3
votes
1answer
373 views

Multiple instance of leaflet on my page

I need a few pointers really; I've got a series of tabs running down the left hand of my page and on each page I have a leaflet map. Each map is based on the choropleth example but I'm running into ...
0
votes
0answers
14 views

Leaflet JS - Polyline and getPopup

I would like to get the popup that was bound to a polyline but it seems that unlike marler objects, polyline do not have such method. Any suggestion ? Also, it seems that the 'popupopen' event is ...
6
votes
1answer
3k views

How to Add/Remove Legend with Leaflet Layers Control?

I have two overlays http://02d0c8c.netsolhost.com/dev/lcb_census_layers3.html that can be turned on and off with a Layer Control. I’d like the legend for each layer to turn on/off along with the ...
0
votes
1answer
27 views

Leaflet Javascript: Layer Control Style in Internet Explorer Messed Up

[Update: Never mind. Got it. Will post the answer later. Thx] Please see this link: http://gisdev.clemson.edu/ffliestemp/ . Only in Internet Explorer the Layer's Control box/panel is expanded all ...
4
votes
1answer
92 views

How to generate image tiles from custom geo data for use with Leaflet

Migrating a webapp from Google Maps API V3 to OSM + Leaflet, which displays custom data that consists of lots of lines and points, on a background map. When this custom data is drawn by Leaflet on ...
1
vote
0answers
20 views

Leaflet snap circle draw to marker

I am looking for ideas/libraries that enable snapping when I create a circle with leaflet draw. There is the libaray Leaflet snap, that enables snapping of draggable markers to polylines and other ...
0
votes
0answers
26 views

GeoJSON layer with local projection in Leaflet

I try to add a GeoJSON layer to my map in Lambert II projection. The GeoJSON contains few points. It don't work if the GeoJSON have more than 1 feature, but for 1 feature, it work ! I don't know why ...
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 ...
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 ...
0
votes
1answer
30 views

Slippy map tile question and good practice

I have created a small slippy map (Leaflet) and have given it a bounding box. If the user tries to pan/slide outside the given bounds then the map bounces back. Also, the slippy map only has tiles ...
0
votes
1answer
42 views

How to add event listener to many markers on the map?

How can I add an event listener to many markers on the map? I know how to add an event listener to a single marker say: var marker = L.marker(...); marker.on('dragend',function(){...}); So, how can ...
0
votes
1answer
36 views

How to compute and add the bounding box for every feature in a given geojson file

I have a geojson file. I need to find the bounding box of every feature in the geojson, then find the intersections between any two bounding boxes. I am using leaflet and Angular to display the ...
0
votes
0answers
33 views

Leaflet center Marker AND Popup on Map viewport

I want center my marker on popup open.. and centering map not in marker latlng, but on center of marker and popup! The problem is that popup has dinamic content(loaded on click). The map size is full ...
1
vote
1answer
32 views

Query data without opening up database?

I have a bunch of polygon data that I want users to be able to sort/filter based on certain criteria. I have the data in a CartoDB table, and can pretty easily use some SQL calls to achieve what I ...
6
votes
2answers
91 views

Color-code a Leaflet polyline based on additional values, e.g. altitude, speed,

I'd like to draw a GPX-track on a Leaflet map. The polyline shouldn't have only one color, but I'd like to show certain values like altitude, speed, heart-rate, temperature, cadence, slope ...
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 ...
0
votes
0answers
21 views

How to use Leaflet CircleMarker with Leaflet Draw

I want to use the Leaflet CircleMarker function together with Leaflet Draw when a marker is put on the map. var drawControl = new L.Control.Draw({ draw: { marker: function ...