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

learn more… | top users | synonyms (1)

3
votes
1answer
2k views

GeoJSON, circlemarkers using the Leaflet OverlappingMarkerSpiderfier plugin

I am wondering if I can use the Leaflet OverlappingMarkerSpiderfier plugin with my circlemarkers. I've loaded a GeoJSON file and added circlemarkers using; var gj = L.geoJson(route, { ...
3
votes
2answers
4k views

Make sidebar div active on Marker click (and vice versa)?

What's the best way to change an element to active when you click on a marker. For example, when you click on a marker on a Leaflet map, how to make it so the sidebar element that's related to it ...
3
votes
2answers
105 views

Mixing coodinate systems

I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines in an area of ~10x10 kilometers in several layers. ...
3
votes
1answer
247 views

looking for an esri compatible javascript engine

I work on an esri heavy team, i'm looking for a mapping engine that will give me flexibility to build on top of and leverage only the pieces I need and or add more as the app grows. I've been using ...
3
votes
2answers
2k views

OpenLayers vs Leaflet for specific app

Could anybody give me some advice on which one should I use? OpenLayers or Leaflet I will implement OSM on a web-app for taxi management. The requirements for the map part are: Tracking of the ...
3
votes
2answers
2k views

Leaflet WMTS layer

I would like to start using Leaflet instead of OpenLayers, but I can't find a way to load WMTS layer into the map. Is that possible with Leaflet, or do I have to stick with OL? I haven't found ...
3
votes
2answers
3k 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 ...
3
votes
1answer
40 views

How to make WFS request using LeafletJS

In the past I have used OL extensively in order to make WFS requests to Geoserver and add layer on a map. Now I am trying to learn LeafletJS and I want to do something similar. I have made a WMS ...
3
votes
2answers
95 views

Placing controls outside map container with Leaflet?

Can someone tell me how I can place controls outside of the map content with Leaflet? In this case, I just want to place the layer switch control outside the map object.
3
votes
1answer
85 views

Leaflet pop-up does not work with Geojson data

I have a geojson file(Polygons).I want to display it on a leaflet map and when user clicks on a polygon, a popup with an information should be visible. The information is 'type'. I am able to see the ...
3
votes
1answer
51 views

How do I get the bounds of a layerGroup in Leaflet?

I have added multiple geoJSON layers to my map by first adding them to a LayerGroup and then adding the layerGroup to the map. Now I want to call fitBounds on the map with the combined bounds of all ...
3
votes
2answers
105 views

Move leaflet polygon to given position

I have a circle and a polygon that I'd like to move to the user's local position. I managed to move the circle latLng but I can't find a way to do the same thing with a polygon. Can someone help me ...
3
votes
1answer
119 views

Leaflet map loads incorrectly when inside a Bootstrap .collapse element

I'm trying to create a Leaflet map which is hidden when the page loads, and revealed when the user clicks a button. I'm trying to use the Bootstrap collapse functionality to reveal the map on a ...
3
votes
2answers
269 views

Generate HTML file with R using Leaflet

I try to display the France map on HTML with RStudio; I followed the tutorial to the World card in Creating an interactive map with leafle; Example works. I wanted to do the same just by displaying ...
3
votes
1answer
329 views

Put LeafletJS geoJSON's into a MySQL database through PHP

I'm doing a project that will let users manipulate a map through LeafletJS, creating circles and polygons on top of the map. I need to gather these inputs for later analysis, using a MySQL database ...
3
votes
3answers
636 views

Prevent Leaflet from requesting non-existing custom tiles

I have created custom tiles using TileMill. extracted tiles as png images and adding them on base layer. using following code var venu_map = new L.tileLayer('static/b18/{z}/{x}/{y}.png', { ...
3
votes
1answer
775 views

How to make transparent the background of a WMS layer in Leaflet

I have inserted the following layer from a geoserver in the following Leaflet map : var nexrad = new L.TileLayer.WMS("URL", { layers: 'Wrecks:WrecksGreaterNorthSea', format: 'image/png', ...
3
votes
1answer
5k views

How to style specific polygons from a geojson with Leaflet

I have a World Countries geojson, that has country codes as "ID" (feature.id) and names as feature.properties.name I would like to color specific countries for making a "countries visited" map. ...
3
votes
1answer
1k 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 ...
3
votes
4answers
635 views

Where to host private CartoDB/Leaflet web app

I am looking for suggestions/recommendations on where to host my cartodb/leaflet map site. It needs to be private with authorized users and have a document management system. So, I was thinking ...
3
votes
2answers
232 views

How to display information in a div outside the map?

I tried a bit around and created a simple map with two polygons(most of the code I got from the Interactive Choropleth Map Tutorial). I added a "L.control()" to show information about the polygons in ...
3
votes
1answer
4k 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 ...
3
votes
1answer
901 views

How to control the order of appearance of markers using leaflet?

I'm plotting out markers from GeoJSON files onto my Leaflet map. Some of these markers overlap so now I want to control the order of appearance of these markers so that one type always sits above the ...
3
votes
1answer
601 views

GeoServer 2.3.0 Proxy Setting

I've upgraded to GeoServer 2.3.0 running on Apache Tomcat 7.0.39 on my host WebFaction. My websites and GeoServer are on same host but different ports. How do I go about setting a proxy so that my ...
3
votes
2answers
2k views

How do I project my WMS tilelayer in leaflet if I want it to display as an overlay on my basemap if they have different EPSG?

So my basemap is a world Mercator projection and in wfs format and I'm trying to put a WMS overlay in a different projection over it? Leaflet's API didn't give me much info on changing the epsg so is ...
3
votes
1answer
73 views

Leaflet Choropleth Map

I'm trying to create a choropleth map using leaflet. When running the code below the map just comes up with each county being the same color. How do I get each county to be colored based on the data ...
3
votes
1answer
122 views

Leaflet: How to style my polygons in a GeoJSON layer?

I am trying to figure out why my polygons are not changing color based on a value I have in my GeoJSON. I've set up a hypothetical test here to replicate my issue here. JSFIDDLE link here My data ...
3
votes
2answers
79 views

Leaflet JS - Add text to circles

I am trying to create a map using Leaflet with circles that indicate distances on the map at current zoom level (map scale). See illustration below: I know how to calculate sizes and update the ...
3
votes
4answers
66 views

Problem in ubuntu loading geoserver wms layer in local server with leaflet

I am just starting to work with geoserver. I am trying to do the same openlayers-geoserver example but using leaflet to view the map instead of openlayers: Publishing a shapefile This code is not ...
3
votes
1answer
46 views

How to fully Style a marker in leaflet?

Styling a marker is possible with pointToLayer I dont know how to get a marker change style for mouse over and for click etc.... var map = L.map('map', { zoom: 14, ...
3
votes
1answer
31 views

How to hyperlink from polygon oncick in Leaflet?

I want to hyperlink from onclick of a polygon to new tab based on 'link' field in polygon json. When user clicks on polygon, a new browser tab is opened pointing to URL value of that polygon. I am ...
3
votes
1answer
245 views

How to change layer order in leaflet.js

I would like to be able to change the order of the layers in leaflet. I tried implementing two leaflet plugins in order to change the layer order. First I tried leaflet-control-orderlayers, which ...
3
votes
1answer
189 views

Zoom in to see details

I have 2 shape files, one that shows all the counties on an island, the other shows all the villages on the island. Here is the scenario: My initial map shows the counties. When you click on a ...
3
votes
2answers
999 views

Easy way to render TileMill tiles in retina mode with Leaflet?

I have a few quick little map websites that run straight off TileMill, without pre-exporting. They usually have code like this: L.tileLayer('http://example.com:20008/tile/MyMap/{z}/{x}/{y}.png', ...
3
votes
1answer
4k views

How to use Leaflet Marker Cluster on markers from Leaflet-layerJSON (Overpass API)

I'm having troubles getting the Leaflet Marker Cluster working with Leaflet-layerJSON. I'm trying to make a Leaflet map with data from OpenStreetMap. The markers are showing on the map, but they are ...
3
votes
1answer
2k views

Make Leaflet Map Background Transparent

How can i make the background of the leaflet map transparent. I see opacity controls from the layers, but not the map background. Should the be changed just with plain CSS? Thanks
3
votes
1answer
4k views

Change default leaflet marker color

I'm using esri-leaflet, and leaflet inherently to add a point feature class (geojson) to a map. What is the best way to add and style the layer? I've see pointToLayer on the leafletjs.com, but don't ...
3
votes
1answer
747 views

SVG control not visible on top of Leaflet.js

I'm using Leaflet 0.7.1 and want to draw a radial menu (like openstreetmap's iD editor) on top using d3. Some examples I found use Leaflet's overlayPane to append the svg element to: var ...
3
votes
1answer
572 views

How can I use Leaflet with esri-leaflet and ArcGIS Online services

I've used public ArcGIS Online services plenty of times in ESRI JS web apps and I imagine that using them as layers in Leaflet is pretty much the same. The one problem I can see is how would one ...
3
votes
1answer
992 views

Options for getting data from SQL Server into Leaflet app?

I have polygon data in SQL Server 2012 that I need to get onto a Leaflet application - we're not talking thousands of polygons, but simplified U.S. counties where only one state will be displayed at a ...
3
votes
1answer
2k views

Drag marker from outside to leaflet map

Is there any way to drag a marker from outside to the map using leaflet Api . Any suggestions plese help me?
3
votes
2answers
736 views

Does leaflet support KML Ground Overlays?

I found an example showing KML overlays at http://harrywood.co.uk/maps/examples/leaflet/kml.html but it only plots vector layer using polygons. Is there any way to plot Ground overlays of KML (like ...
3
votes
1answer
4k views

CloudMade Routing with Leaflet: route is not displayed

I am trying to consume the CloudMade routing API using Leaflet. So far, I have managed to pass points and receive a response, and parse that response into an array of points. The array of points is ...
3
votes
2answers
72 views

Vector under OSMbuildings

I would like to display a circle object under the OSMbuildings layer with OSMBuildings . I was trying to change zIndex, bringToBack(), bringToFront() but it doesn't work. I don't use my own GeoJSON ...
3
votes
1answer
57 views

Leaflet geojson styling leaves gaps between polygon

I'm styling a geojson polygon composed of multiple closely placed vertical segements which doesnot have a gap in between (i've checked the topology). I want to display just the fill and without ...
3
votes
1answer
46 views

Use custom dataset for routing

I'm looking to substitute my own dataset with OSM data in Leaflet Routing Machine or another routing tool. Is this possible?
3
votes
1answer
65 views

Get tile layer intensity at given zoom and longitude/latitude (Leaflet)

I can display a tile layer as an overlay in Leaflet via an url of the form path/to/my/tile/layer/{z}/{x}/{y}.png : my_overlay = L.tileLayer('http://path/to/my/tile/layer/{z}/{x}/{y}.png', { maxZoom: ...
3
votes
1answer
253 views

Using Waze map tiles with Leaflet

I came across this Map Comparisons where they have used Waze map tiles. I searched around and couldn't find any official documentation for using Waze tiles in leaflet. I couldn't even find their ...
3
votes
1answer
106 views

Leaflet + GeoJson = problem with style

I got my first leaflet + geojson project partly working! (even the popup with content from the geojson file!) but I still have a problem with style the geojson (export from mapbox) file has point, ...
3
votes
1answer
223 views

Control to select data source on Leaflet map

I am building a map using leaflet. My data source looks something like this: var districts = {"type": "FeatureCollection", "features": [ {"type":"Feature", "geometry": ...