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

learn more… | top users | synonyms

5
votes
6answers
1k views

3D perspective on maps in Leaflet, CartoDB?

Are there any JS library out there that would render normal, flat maps (like Leaflet) into a perspective map like this one, on the web: Also, anyone seen anything that could turn CartoDB data into ...
0
votes
0answers
29 views

Is there a way to convert L.circle to a geodesic polygon in Leaflet

Reference: How to make a predetermined Polygon (Circle) From 4 Coordinates, The Radius and Center Longitude and Latitude in Openlayers Openlayers uses this function : createGeodesicPolygon Question: ...
0
votes
1answer
45 views

Bootstrap3 Resize map height for phone

I have a leaflet map in a bootstrap 3 html application. I have content both above and below the the map which has a height of 600px. When I access the application from a phone, the width of the map ...
0
votes
1answer
93 views

Leaflet Custom Control Fails

Why does the myMenu control not respond to a click? var map = L.map('map').setView([51.505, -0.09], 13); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: ...
2
votes
2answers
711 views

Incorporate Google Streetview into a Leaflet map

The person who asked the question at the link below way back in 2011 said, "I understand that it is possible to incorporate Google StreetView into non-Google apps". Can anyone tell me how this is ...
2
votes
2answers
67 views

zoom over vector in leaflet

I have created a map from geojson file of administrative boundaries (polygons layer). Similar to this example. When the mouse is over the polygon feature, the cursor changes from hand to finger. In ...
1
vote
1answer
107 views

Leaflet rendering TileMill tiles in the wrong order

I'm stumped, and quite a lot of searching has turned up nothing helpful. I'm on the first step of what will ultimately be a map with three raster layers and three layers of markers (with controls to ...
3
votes
1answer
263 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
1answer
62 views

Leaflet Layer Control appended to panel but duplicated

So I've used jquery append to attempt to move my leaflet group layer controls on to a panel. This was successful, however the original still exists on the right side of the map object. I've tried to ...
2
votes
1answer
374 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
1answer
245 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 ...
2
votes
0answers
104 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 ...
1
vote
0answers
35 views

Leaflet - Enable/Remove popup on mousedown/mouseup?

I'd like to do as the title suggests and can get the popup to appear on mousedown with the following code, but mouseup doesn't close the popup: // Quick look at info on mouse hold ...
3
votes
0answers
43 views

How to update location via a data streame in openlayers or Leafletjs

I'm developing a application where I need to real-time update a Location of a Map using a data stream, I'm planing to use web-sockets, Are there any guides I can follow? Or can you guys direct me in ...
1
vote
2answers
114 views

I want to show the information of several layers of a request made ​​GeoJSON geoserver

Always enters the error function and shows me the alert 'what happen?'. This is the piece of code that causes problems: map.addEventListener('click',onMapClick); function onMapClick(e) { var ...
2
votes
1answer
44 views

When I publish a layer(shapefile or postgis) with TileMill, 200 meters moves

I hope someone can help me. Not if you know the TileMill application I'm working with her to publish layers look more beautiful. Well, first I have posted directly loading the shp file., But when ...
2
votes
2answers
95 views

Flannery compensation in Leaflet JS

I'm creating a bubble map using Leaflet JS. Everything is working smoothly (LeafletJS is awesome!) but now I'd like to try flannery compensation on the bubbles. I can't find the math anywhere though. ...
0
votes
1answer
106 views

Leaflet WMS Google Maps Engine

I am trying to connect to my Google Maps Engine Map using WMS in my leaflet application. I am able to connect just fine with ArcMap. However when using leaflet, I get 'no data for requested ...
2
votes
2answers
554 views

Can I use leaflet to access a WMS service published as an OpenLayers javascript API?

I would like to add this layer to a site I'm working on that uses leaflet: http://116.240.195.134/vicmapapi/UserGuide.jsp The API itself is a javascript file based on OpenLayers: ...
3
votes
1answer
216 views

leaflet choropleth map using dynamic value

I am doing a choropleth map using leaflet and JSON data. I got a clean tutorial in leaflet site. In that tutorial the used us-states.js JSON file where the choropleth was based on the ...
0
votes
1answer
80 views

Make two layers editable in leaflet draw

I use Leaflet draw to draw markers and polygons on a map. The created features are saved to two separate feature groups. One feature group for the markers and one for the polygons. Now I want to edit ...
0
votes
1answer
62 views

Using photon in a Leaflet code: example?

I need to put a geocoder in a Leaflet page and I'd like to uso Photon (rif. http://photon.komoot.de/). There is a leaflet plugin here https://github.com/komoot/leaflet.photon but no example is ...
5
votes
1answer
160 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 ...
1
vote
1answer
75 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. ...
4
votes
1answer
93 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 ...
1
vote
1answer
55 views

Leaflet circle radius unit?

Leaflet circle has two radius properties: _mRadius, which is the radius in meter, and _radius. Is _radius in radians or what is the unit of it?
0
votes
2answers
64 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
0answers
48 views

leaflet.js ImageOverlay projection bug

We are trying to display a image over the leaflet map using "ImageOverlay" layer, but it does not work according to expected. In Google Maps works perfectly. Apparently Leaflet just stretches the ...
2
votes
1answer
302 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 ...
1
vote
1answer
171 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 ...
0
votes
3answers
360 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 ...
0
votes
0answers
270 views

Combining Feature Selection and Marker Clustering

I am using the basic structure for layer toggling found in this CartoDB tutorial, with buttons wired to a ul navigation menu. In the meantime, I was happy to implement the Marker Cluster Leaflet ...
3
votes
1answer
746 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 ...
2
votes
0answers
48 views

LeafletJS animated marker with video

I have used the leaflet.animatedmarker from openplans on GitHub to create a marker that moves along a line. I also have added a video that will popup above the line. This plays fine with the marker ...
2
votes
0answers
52 views

Leaflet Marker Dragend Bug/Difficulty

I am having a problem with leaflet markers. The problem is that when I drag a marker with a lower z-index under another marker with a higher z-index and let it go, it makes another marker. I have a ...
10
votes
3answers
3k views

Examples of leaflet interactive mapping applications

I would like to develop a simple mapping application. One where users can digitize lines, polygons and points and attribute the features. The attributes will then be stored in a database for later ...
1
vote
1answer
157 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. ...
1
vote
3answers
275 views

Using geojson hosted on GitHub from Leaflet: it doesn't work

I'm trying to use a geojson hosted on GitHub (rif. https://raw.githubusercontent.com/cesaregerbino/DatiGeo/master/ScuoleTorino.geojson), from Leaflet. here you are my code .... My first ...
6
votes
0answers
53 views

Data Feed for Space Weather / Aurora

I am building a map application for a northerly area and would love to bring in a feed of northern lights prediction/probability (like below). http://www.gi.alaska.edu/AuroraForecast Does anyone ...
0
votes
1answer
51 views

Drop Marker with 3857 projection in leafletjs

Is it possible in leaflet to drop marker with 3857 projection on map? I fond a solution where first translate point to 4326 using proj4js and than drop it on map. var source = new ...
1
vote
1answer
76 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
38 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 ...
2
votes
0answers
109 views

Leaflet Drag and drop to change existing markers

I'm working on a project where the user should be able to drag an image to a pre-existing marker and have the marker update color if the value of the marker (a value w/in the geojson) and image (a ...
1
vote
1answer
86 views

getActiveLayers for LeafletJS

I'd like to identify the layers that are currently active (which basemap is currently in view and which overlays are currently turned on). Was hoping to find something akin to getActiveLayers in the ...
0
votes
0answers
42 views

Handling Popups in Leaflet with Overlapping Features

I am new to Leaflet as well as Javascript, and I'm looking for some advice on a basic topic. Currently, I am trying to create a spatial index of library holdings for old topographic maps that people ...
0
votes
1answer
33 views

Is there a widget/service to put a marker and send data?

I need to ask people where they want to go in the city, and as a response I need either geocoded location, or a marker on a map. Although everyone knows his home address, not everyone knows the ...
3
votes
2answers
870 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
0answers
126 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
957 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: ...
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 ...