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

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

condition that displays two div different with leaflet

I wanted to create a condition that displays each time according to different div click on the data on the map info.update = function (props) { if (e.target.feature.properties.selected == ...
0
votes
0answers
8 views

Markers display with leaflet and javascript

I have a problem displaying data relating to schools on a div 'info' when click the marker with leaflet and javascript: function highlightFeature2(e) { var layer = e.target; layer.setStyle({ ...
0
votes
1answer
6 views

Leaflet push GPS position to array onLocationFound and search a squared area around this position

So I have this approach of pushing the coordinates of a location to an array: var gpsposition = [], function onLocationFound(e) { gpsposition.push(e.latlng);} Now I have the following questions: ...
0
votes
0answers
70 views

Calculating pixels in leaflet

I am working with leaflet plugins, calculating distance between two points of a polyline or whole distance of joint/multiple lines Work : I set up the script to measure the distance in meters when ...
3
votes
1answer
453 views

Leaflet custom div & click propagation on other elements

I've gotten custom HTML applied successfully within my #map element (where Leaflet is appended) but I'm having unusual behavior with other Leaflet objects that find themselves within the transparent ...
5
votes
3answers
46 views

Different values while calculating distance

I'm developing a project using LeafleatJS and PostGIS. Currently I'm getting trouble while calculating distance between two coordinates. For example: Point 1 - lat: -12.99835864475412, lng: ...
2
votes
0answers
40 views

Can we set the latlng start point : leaflet

I am working with the leaflet api. I am trying to figure out how to change or set the latlng start point in leaflet map. Currently i am working on use image as map,,,,the latlng(0,0) is at the ...
4
votes
0answers
46 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
-1
votes
1answer
34 views

CartoDB Point Clustering and on Hover

I have been working from a sample on point clustering from cartodb. I would like to have an infowindow show when someone hovers over a series of points. This infowindow will display a different ...
2
votes
1answer
16 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 ...
1
vote
1answer
278 views

Pass coordinates parameters to geoserver pgrouting service from Leaflet wms tile layer

I've configurated a pgRouting service in Geoserver, following the steps on the documentation it's easy to accomplish. Reading the documentation, existing examples, etc.. I've come to undestand how ...
0
votes
0answers
123 views

redraw canvas when add new overlay?

How to redraw canvas when I add overlay layer? Firstly load osm map, then creates canvas. So when I push the botton and add another layer it looks like sandwich and canvas in a middle...first layer - ...
1
vote
0answers
12 views

Leaflet printing does not show pins and map is shifted

I don't exactly why but whenever I try to print my leaflet map with layers, it shows the map a little shifted to the left as well as the pins are not quite ok. I tried using easyPrint() and ...
1
vote
1answer
1k views

How do I add elevation data to a GeoJSON line from a GPX file?

I understand that elevation can be added as an optional third value in Coordinates (lat, long, elev) in a geojson file, but I can't find a way to actually do that from a gpx file. I've used ogr2ogr to ...
1
vote
0answers
17 views

Non-HTML circle text labels on Leaflet map

I need to save image of Leaflet map with polygon, multi-polygons, circles and text below every circle. I have geojson file with circle and polygon coordinates (lat and lng). I managed to get image of ...
2
votes
1answer
23 views

Invalid Geojson when drawing multipolyline on the map

I try to display multi line in the map but it return "Error: Invalid GeoJSON object" Here is my code $.ajax({ type: "POST", url: "server/drawPipe.php", ...
1
vote
1answer
179 views

Leaflet + GeoServer + British National Grid

I have followed along some examples and was able to display BNG 27700 data nicely on the map, however now I want to perform getFeatureInfo function on click. Again the code I used is as below: var ...
1
vote
1answer
196 views

CartoDB JSONP callback in leaflet-search plugin

long time reader, first time question-asker etc... So I'm trying to implement a search function on an app I'm building using data from cartodb in leaflet and this leaflet-search plugin: ...
1
vote
0answers
40 views

Scale (or stretch) Leaflet map tiles to look bigger

I am using leaflet and I am using the same tile provider as the main openstreetmap's website (http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png). However, leaflet seems to fit many more tiles in 1 ...
1
vote
0answers
14 views

Leaflet polyline not working

I'm trying to draw polyline to connect an array of waypoints. But I'm getting an empty div like this instead of a map with route. My code is this: <script> // set center ...
2
votes
1answer
43 views

Leaflet Routing Machine: how to dinamically change router settings?

I'm using Leaflet Routing Machine in a litte Leaflet + Javascript map. I'm using Graphhopper as router in this way .... var control = L.Routing.control({ waypoints: [ L.latLng(57.74, 11.94), ...
2
votes
1answer
505 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 ...
0
votes
1answer
559 views

Leaflet geoserver wms doesn't show on google map base layer

I have a site running Openlayers (base layer google and overlay wms in epsg4326 from geoserver). The site works fine. I've decided to try doing the same with leaflet , and from some reason I can't ...
3
votes
2answers
77 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: ...
2
votes
1answer
289 views

Load Leaflet map in canvas element

I am working with leaflet tiles loading tiles to a map div http://jsfiddle.net/tBCd5/ I am now playing with some html5 canvas distortions like below http://jsfiddle.net/UF4PK/ It would be cool to ...
2
votes
1answer
24 views

Convert/display grayscale image as RGB

i want to display raster images using a color palette in a leaflet map. The images are tiled (gdal2tiles) from a single .tif to multiple .png files with values from 0 to 100. I add the image using ...
1
vote
0answers
9 views

Leaflet _onDrag throws TypeError: this._positions is undefined

I am creating a map using the MapQuest API with Leaflet. Up until today the map worked fine in development and no errors were being shown in FF dev console. This morning when I was giving a ...
1
vote
1answer
490 views

Leaflet update getcenter coordinates

I am bringing in leaflet routing control into my map and I would like to have the route icons show up in the center of the current view. using the code below I can get the icons to show up at the ...
0
votes
1answer
271 views

map.on('click') event disables the double click zoom

I have a map that has an onclick event fired and displays a marker where the user has clicked. Problem is that this event seems to overrun the double click event. Because of this, when I double click ...
3
votes
1answer
69 views

Using MSID/MID with leaflet to display Google My Maps data

I'm wondering if there is a way to display MSID/MID with leaflet. I found this forum below; Any way I can load KML data from Google maps (again) via JS API? KMZs work fantastically with the arcgis ...
1
vote
2answers
25 views

Remove layer switcher controller in leaflet

I have created a map in leaflet and added an overlay as: map.layerscontrol.addOverlay(tile_layer,"{{ resource.title }}"); map.addLayer(tile_layer); The map shows great and the layer as well. Now I ...
2
votes
1answer
14 views

Render rotated symbols in Leaflet

I have point with an attribute for each point's 0-360 direction. I need to render these points in Leaflet with arrows pointing in their respective directions. Is there a plugin or code I can use to ...
4
votes
1answer
32 views

How can I change popup position on leaflet marker?

I want open a popup on bottom of my marker icon in leaflet. my code: var mymap = L.map('mapid').setView([51.505, -0.09], 13); ...
1
vote
2answers
580 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 ...
0
votes
1answer
35 views

Hide/Show leaflet markers based on specific values

I have a Python list of dictionaries with a number of IPs and "Scores" for each IP. I'm adding them to my front end map / leaflet using jinja2 like so: var map = L.map('map') ...
0
votes
1answer
433 views

Leaflet: Scroll wheel controlling map zoom and not drop down menu

Edited 6/19/2015 I have a custom leaflet control box with a drop down menu. When I use the scroll wheel over the menu, the map changes zoom level instead of scrolling the menu. The problem occurs ...
1
vote
1answer
330 views

Add an event listener on a Marker in Leaflet

I am using leaflet in order to render a map. I created a map with markers and i dont know how to implement the Event Listener 'onClick' on each Marker. My code var stops = JSON.parse(json); var map ...
0
votes
1answer
260 views

How to filter polygons in Leaflet using range slider

I have a map I'm working on with Leaflet that displays a choropleth of zip code-level data. One piece of functionality I would like to add is to allow users to use a range slider to filter out ...
2
votes
2answers
500 views

How to tell if a GeoJSON path intersects with another feature in Leaflet?

I have an application where the user draws a path (a series of connected straight lines) and this path may not intersect any feature in a particular GeoJSON layer. I need to check that no point along ...
1
vote
1answer
1k views

Reset leaflet routing machine route and controls

Im trying to build a geolocation based routing app in angular using leaflet.js and leaflet routing machine. I have this 'addRouting' function where I pass in a users location (fromLat, fromLng) and ...
2
votes
2answers
26 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.
0
votes
1answer
1k views

Positioning leaflet divIcon when adjusting size using css

I am using the L.divIcon when using iconSize:null which is causing iconAnchor:[0,0] to not be recognized,my code looks like this: var divIcon =L.divIcon({ className:'current-location-icon', ...
1
vote
1answer
25 views

How to check if a leaflet layer is already added on the map?

I build a simple map app where I have a layer on top of a map. How can I check in leaflet, if the layer is already present?
1
vote
2answers
265 views

Leaflet and census block data: not displaying

I am new to leaflet and am trying to load a geojson file showing census blocks and associated information for a city in CA. It is a small city and not too many census blocks. I cannot get the popup ...
0
votes
1answer
400 views

Creating Leaflet layer that can be toggled in layer control from CartoDB viz.json?

How do I create a leaflet layer that can be toggled in the layer control from a cartodb viz.json? I have read that the cartodb.createlayer does not create a leaflet layer. It seems you can add the ...
0
votes
2answers
2k views

Leaflet.js map - Pan too and Zoom in on point

This is the first time I am using Leaflet.js. I am trying to create a story map but have come across an issue. Currently I have a map with a scrolling text bar on the left hand side. I would like ...
1
vote
1answer
220 views

Is there any method to retrieve SQL queries into a GeoJSON file using JSP?

I want to display the contents of my PostGIS database of various shape-files in leaflet pop-up dynamically. I know there are static methods available that retrieves attributes. But I need to by ...
1
vote
0answers
23 views

Display a layer stored in GeoServer with Leaflet

I wanted to display a layer stored in geoserver with leaflet, I used this code but it's not working. var map = L.map('map').setView([4.477411, 21.309284], 3); ...
1
vote
0answers
21 views

Leaflet javascript in popup

Can JavaScript be included in a leaflet popup? We have modified this example To this :- var this_marker = L.marker([51.5, -0.09]).addTo(mymap).bindPopup( '<div style="color: ...
2
votes
1answer
14 views

Setting (above/under) priority order of layer in leaflet

When I add a layer in leaflet it stays automatically above all layers I want layers to be ordered wich one stays above the other in way that last added layer will not stays above and hide the other ...