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

learn more… | top users | synonyms (1)

2
votes
1answer
26 views

Can reference system in Leaflet be changed without disrupting data position?

I have a leaflet map that uses default CRS (EPSG3857) with multiple markers placed on it. Their LatLng are read from JSON file. I want to change map CRS to Simple, keeping markers on exact same screen ...
2
votes
2answers
59 views

Leaflet zoom less than default

How can I make leaflet zoom less with mouse wheel ? If I move my mouse wheel as little as I can, it zooms like 3 levels.
2
votes
1answer
88 views

Highlight feature below mouse-overed track in Leaflet

Currently, on http://velo300.free.fr/debug, feature highlights on 'featureOver' creating a white new feature on top of mouse-overed feature. Problem: i need also to work with 'featureclick' for ...
2
votes
1answer
55 views

CartoDB SQL API styling individual polyline returns

I am creating a web mapping application that will return appropriate routes based upon ST_length query on a cartoDB dataset. So far, the code below successfully maps those routes (and clears any ...
2
votes
1answer
68 views

Update Bootstrap Switch with Leaflet Layer Group

I have this JSFiddle that shows two example layers that can be toggled on and off using the Bootstrap Switch to add and remove them from the map; this works fine. The problem I am having is updating ...
2
votes
1answer
39 views

Accessing First Member Coordinates of geoJSON

I apologize if this is trivial or not possible, I am new to GIS. So I have a geoJSON file with thousands of members, each with a point coordinate. Is there a way for me to access the first coordinate (...
2
votes
1answer
323 views

How to get the current user location automatically every “x” seconds and put it on a Leaflet map?

I need to get the current user location automatically every "X" seconds (5 or 10 sec.) and put it on a simple Leaflet map. I've seen the Leaflet on Mobile sample here http://leafletjs.com/examples/...
2
votes
1answer
107 views

Mutually Exclusive Bootstrap Checkbox Switches as Layer Control

I have this JSFiddle with two checkboxes using Bootstrap Switch that changes the layer visibility in Leaflet. I would like them to be mutually exclusive, i.e neither of them can be on or off at the ...
2
votes
1answer
38 views

Displaying colored traces and waypoints

Goal: display map with few routes, which have colored segments. Also displays few waypoints with text + gives option to download few gpx routes and additional text. I see that gpx format has ...
2
votes
1answer
467 views

Filling contour levels with grain (texture) using Leaflet

I created a program to draw temperature contour map of France: This is the code: library(ggplot2) library(gstat) library(sp) library(maptools) require(rgeos) library(rgdal) library(foreign) library(...
2
votes
1answer
77 views

Birdseye Viewer in other applications?

has anyone used Bing Maps Birdseye Viewer tiles in other applications? I have seen Leaflet Bing but it looks like it just has aerial, aerial with labels and road tiles. Does it have birdseye tiles? Is ...
2
votes
1answer
118 views

Is it possible to show Leaflet Marker Cluster with JSON API?

I have a problem with displaying Leaflet Marker Cluster working with Leaflet-layerJSON. There are markers, but I cannot show the clusters. This works with GeoJSON, but now I have different data ...
2
votes
1answer
171 views

Adding a Mapbox Studio basemap to leaflet

I am using Mapbox Studio, customized a nice basemap, and downloaded it. It downloaded as a .json file with a couple thousand lines of code. I want to be able to use this basemap (called basemap....
2
votes
1answer
344 views

Zoom to GeoJSON point feature in leaflet

I'm relatively new to Web Mapping and trying to develop a litte Application with Angular JS and the angular-leaflet-directive. In this application I will work with a GeoJSON point layer representing ...
2
votes
1answer
91 views

Tiles from gdal2tiles won't appear on leaflet map

I added the OSM tiles and my tiles(193ortho) which I am serving from the same folder that html file is in, but the tiles I made won't appear. The tiled images appear fine in the webviewer that is ...
2
votes
1answer
220 views

Offline Map with mapnik: Tiles are vertically unaligned and randomly displayed (Leaflet + Tilecache + Mapnik + Postgis)

I'm new to maps and currently I am developing my first offline Map with OSM data. I have map data added to postgres via osm2pgsql and installed mapnik 2.2. For caching I have used tilecache with ...
2
votes
1answer
225 views

Cartodb add basemap switcher

I currently have a map created entirely in the CartoDB editor, including custom map. For some reason it doesn't allow you to add an attribution in the editor but thats a different problem. So my map ...
2
votes
1answer
44 views

Input a number for user's number entry

The following code works fine. When I click the "Test Play/Stop" button a series of points from the 'geojson' list are drawn with popup attributes one by one. The time interval is defined by the ...
2
votes
1answer
962 views

Using Mapbox (LeafletJS), how do I edit imported shapes from GeoJSON?

Overview: I'm currently working on a project where I'm importing GeoJSON into a map using Mapbox. However, I'm wanting to be able to edit those shapes once imported into the map. I've gotten the ...
2
votes
1answer
799 views

How to update data in Leaflet Control?

I have a Leaflet map with a control to switch between various basemaps or toggle on/off some overlay data. //Basemaps are all a-okay //Start with no polylines in my overlayData items = []; ...
2
votes
1answer
289 views

How can I automate interactions with vector features in Openlayers3(canvas) like it is done in Leaflet(SVG)?

I want to automate and test some aspects of my map application in Openlayers 3. I mainly want to automate clicking on markers and other vector features(ideally through the DOM using xpath like SVG). ...
2
votes
1answer
785 views

Fetching postgis data through php json and passing to leaflet map

I am new to this and trying to explore leaflet and geojson a bit. Please help me with this. This is my php page which I am using to fetch data from PostGIS. (the data opened successfully in the ...
2
votes
1answer
3k views

Leaflet Marker Mouseover Popup

I've tried to make a MouseOver Markers Popup since a couple of days, I'm using Leaflet. I know some solutions I've read in many forums, but I wanna make it work with GeoJSON-Points and I haven't found ...
2
votes
1answer
3k views

Adding drop-down menu on leaflet map instead of L.control

I have created a choropleth map including several layers from the same geojson layer which is turkeyData in my case.I actually did it and it works fine. But I like to change the standart leaflet ...
2
votes
1answer
1k views

Leafletjs get latlng center position of polyline

After drawing a polyline, I would like to draw a circle from the center of this line whose radius encompasses the entire line. For polyline's that have more than 2 points I can crudely get the center ...
2
votes
1answer
607 views

Get all tileLayers from L.map object in Leaflet

What is the best way to access all displayed tileLayers from a L.map object? Traditionally, I have stashed tileLayers in an object that I can access later, like so: var mapLayers = {} if (! ...
2
votes
1answer
1k views

find inner bounds of a polygon in leaflet

How can I find the inner bounds of a polygon in leaflet? I a want to plot points randomly in polygoon but when I say Layer.getBounds() I get the bounds and I can still plot the markers ...
2
votes
1answer
554 views

Leaflet Marker-Cluster JSONP GeoServer

I hope I can get same help from here. I started to put together a leaflet map, please see here: http://gis.xyz/leaflet2.html I want to show my postgis point (uk based) features on this map with ...
2
votes
1answer
233 views

openlayers leaflet and popup

I am working on a map mixing openlayers and leaflet librairies (it is possible, correct ?). I am such a beginner that, after lots of readings, I thought creating popups was less difficult for me ...
2
votes
1answer
465 views

Moving from OpenLayers to Leaflet breaks tilecache

My tilecache.cfg is like so (working with MapServer) [mylayer] type=WMS url=http://server/mapserver/app spherical_mercator=true layers=mylayer The following works just fine var mylayer = new ...
2
votes
1answer
2k views

How to get the total km of route using Leaflet Routing Machine API?

I'm using machine leaflet route to draw routes I can get the total route miles? How can I do this? I know the class IRouteSummary, but I am unable to access it. Just wanted an example so that I can ...
2
votes
1answer
332 views

How to add labels parallel to lines, polylines or multilines using Leaflet?

I want to add road name parellel to its line or if the line is curved, then the label should also be curved. How to add these name labels using leaflet? example image
2
votes
1answer
472 views

How do I use Proj4Leaflet projections correctly?

I'm loading data layers from a WMS server into a Leaflet map, and I need to give the user a choice of projections. For the WMS server requests, I just need to change the CRS parameter to a different ...
2
votes
1answer
285 views

Can't project ArcGIS Tiled Service for Esri-Leaflet

I'm following this example from the esri-leaflet docs. I have an ArcGIS Tiled MapService in ESRI:102696. So I'm trying to use Proj4Leaflet to project the service and use it in my application. I ...
2
votes
2answers
826 views

Adding multiple layers with timed delay in Mapbox/Leaflet

So I've got a Mapbox map showing data split into several layers. I'd like the user to be able to click a play button to call the function "gogogo", and then the layers get added one at a time every 1 ...
2
votes
1answer
522 views

Z-Index in GeoJSON features using leaflet

I have a watershed polygon with sub-watersheds contained within the larger watershed. I would like the sub-watersheds drawn on top. Can i control the drawing order of features within a geojson object ...
2
votes
1answer
694 views

Why doesn't LeafletJS complete the conversion when re-projecting to Spherical Mercator?

When I use the Mapbox Leaflet pre-packaged Projection class SphericalMercator to project a lat/long coordinate into EPSG:3857 I have to multiply the result Leaflet provides by the earth's radius. ...
2
votes
1answer
534 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
744 views

OpenLayers3 vs Leaflet for styling multifeature geojson

I'm experimenting with various options for displaying geographic information to the public in html format. The ultimate aim is to build an online application where anyone can add the route they cycle ...
2
votes
1answer
280 views

Leaflet SVG layer is obscuring the underlying GeoJSON interactivity

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 within the leaflet-overlay-pane? (For example, how ...
2
votes
1answer
768 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 ...
2
votes
3answers
320 views

Start-Marker from geojson polyline

i have a map with some walking- and bike-routes and popups with a few details and a picture. Now i want to set a marker on the first vertex of a geojson polyline, but i cant find out how. Btw. i´m ...
2
votes
1answer
779 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 '...
2
votes
1answer
441 views

Leaflet.js and CartoDB.js event conflict

Little problem here. I’ve got a layer from a CartoDB viz that I’m listening to the featureclick event. When a feature is clicked I highlight it by applying cartoCss. However, I want to unhighlight it ...
2
votes
1answer
285 views

Super large scale maps with Leaflet, how?

I have a map/architectural drawing of two floors of a huge building with a lot of rooms. Now I'd like to make an interactive slippy map using preferably Leaflet showing all the rooms and use markers/...
2
votes
2answers
2k 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 ...
2
votes
1answer
160 views

advice on browsing multiple points with leaflet - query only the points in the viewport

This a very basic question, but I don´t quite know where to start I have a postgis table with aproximately 15.000 points hosted on CartoDB And I'm developing an application that should let the user ...
2
votes
1answer
246 views

Value at a particular spot on Geoserver Heatmap

Geoserver is drawing from a PostGIS database to generate a heatmap using this SLD extension. Leaflet then overlays the heatmap over the base layer. Question: How can you determine the value at a ...