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

learn more… | top users | synonyms (1)

1
vote
2answers
42 views

Is there an editor for Leaflet JavaScript that has intellisense functionality?

Is there an editor for Leaflet JavaScript that has intellisense functionality? I've tried both Visual Studio 2015 and Visual Studio Code ... in 2015, if I type code like var geojsonlayer = L and ...
1
vote
1answer
34 views

Displaying raster images using Leaflet?

The purpose is to create a small web application using an open source product, preffered Leaflet (but I will Switch the product if it works within another Framework than leaflet), simply showing a ...
0
votes
1answer
25 views

What SRS does leaflet use when it creates new markers?

I'm using leaflet 0.7. I'm wondering what spatial reference system is used when a new marker is created? Also, how does this impact my use of maps? (I'm using leaflet .7 because of dependency ...
1
vote
1answer
233 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
1answer
29 views

Realtime in Leaflet with Socket.io

I'm trying to get events on the client side and showing changes (new markers) in realtime on a leaflet map with socket.io. The problem is in defining data that comes from socket.. I don't know the ...
1
vote
1answer
24 views

Leaflet subdomains: if subdomain is down, attempt another

When giving leaflet an array of subdomains for a tile layer, how can I cause it to try a different subdomain if the attempted subdomain is down? For instance, adding this layer: var map = L.map( '...
0
votes
1answer
31 views

Projections leaflet and OSM

I downloaded data from OSM and extract lat/lng coordinates from a user who is clicking on a leaflet map. So my program returns the coordinates where a user clicked! I am wondering what crs I need to ...
10
votes
1answer
912 views

How to add an attribution on a GeoJSON Layer from Leaflet?

I need to use a GeoJSON Layer on my Leaflet map. Here is a sample of my code: function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) { ...
0
votes
1answer
222 views

How to calculate a map scale with bounding box, width and height?

I have a map that will allow the user to select or slice images/pictures out of it. As example a map width is 1200px * 1200px and the user selects say 700px x 700px square (note: aspect ratio is ...
-1
votes
1answer
289 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 ...
1
vote
1answer
32 views

Is it possible to cluster polygons in Leaflet?

Is it possible to cluster polygons in Leaflet? In a similar way to the Marker Cluster plugin
0
votes
1answer
298 views

How to draw a rectangle on a Leaflet map from GeoJSON data

I am trying to draw a rectangle on a Leaflet map with JSON data which looks like this. var geojsonfeatures = {"type":"FeatureCollection","features":[ {"type":"Feature", "geometry":{"...
0
votes
1answer
102 views

How do I store GeoJSON format in Firebase so it can be used for Leaflet GeoJSON

I am new with Firebase, Leaflet, and GeoJSON .. I have a question, how to store data with GeoJSON format in Firebase, so it can be retrieved and used for leaflets GeoJSON to display marker(s). I know ...
1
vote
3answers
3k views

How to update a popup content from its marker?

I created a popup with Leaflet doing so: marker.bindPopup(content).openPopup(); How can I update the content value afterwards? I suppose to do it from the marker, something like this: marker....
0
votes
1answer
261 views

serving UTFgrid information made with mb-util with leaflet

I've created the mbtiles file with tilemill and exported it on my ubuntu webfolder with the following command: mb-util --scheme=xyz /folder/tile.mbtiles /var/www/html/my-tiles To get utfgrid ...
1
vote
1answer
47 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
1answer
38 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: red">Hello<...
2
votes
1answer
47 views

How in-sync is the MapBox flavour of Leaflet with the FOSS version?

How in-sync is the MapBox flavour of Leaflet with the open source version? I'm concerned that if I got with the MapBox sku, I'll be locking myself into a non-standard version, so things like ... are ...
-3
votes
0answers
19 views

div 'map' in 3 part [duplicate]

I wanted to split the div 'map' of 3, part contains the map, another the legend and 3rd layers with leaflet image
2
votes
2answers
642 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 ...
0
votes
1answer
46 views

Leaflet Map Layout

I have been learning how to use leaflet recently and have create a number of maps which have all been full screen maps. I would like to understand how I would place other features on a web page along ...
0
votes
0answers
18 views

How import variable from leaflet.markercluster

Maybe someone can help me... How i can import variable from leaflet.markercluster if i using webpack. I can't find class, which i can import. https://github.com/SINTEF-9012/PruneCluster
3
votes
1answer
57 views

Click event returning wrong Y container point in Leaflet

I am using QGIS Server and Leaflet to display geotiffs on my website. I have created an onMapClick function which uses a GetFeatureInfo request to QGIS Server which returns the value of the geotiff in ...
0
votes
0answers
28 views

How to make leaflet image overlay draggable?

I simply want to make a georeferenced imageOverlay draggable in leaflet. I found several unanswered posts (e.g. here and here). Since it is easy to make markers draggable, someone tried to adapt the ...
3
votes
1answer
75 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 window....
1
vote
3answers
38 views

Is it possible to limit the records retrieved from a GeoJSON file?

Is it possible to limit the records retrieved from a GeoJSON file? I have a data file in GeoJSON format that my Leaflet page loads from a local text file and displays as a series of markers But it's ...
18
votes
4answers
29k views

How to load external GeoJSON file into Leaflet map

I would like to load a geoJSON (polygon) file into my leaflet map. I have seen examples where geoJSON is embedded into the javascript code but I can't find any examples showing how it is done with an ...
14
votes
4answers
18k views

Custom Leaflet Controls

I have gotton some help in creating a custom control for leaflet, but I am still having trouble upgrading to the CSS styles used by the latest versions of Leaflet. Basically, all I need is a icon in ...
0
votes
1answer
27 views

Cannot get L.control.coordinate to work properly

I am trying to make a map modal with Leaflets that displays the lat./lng. coordinates in a box when the user clicks on the desired point. I got the popup given in the Leaflets tutorial to work fine ...
1
vote
1answer
813 views

How can I project geojson borders on the google earth tiles in leaflet?

I started working with leaflet and google earth tiles. I want to add borders on my map so I tried to use the countries geoJson Data as a layer on the map. The problem is that the json borders ...
0
votes
0answers
12 views

how to update control content when adding it to map in leaflet

I have a control which displays its content based on the current map position. In the onAdd method I create its components but cannot style them using jquery methods (likely because they are not fully ...
1
vote
1answer
248 views

A problem with event firing upon mouseout

I'm trying to create a point map that displays information about a point in an info box upon user mouseover and changes the styling of the point. On mouseout, I want the info box and marker styling to ...
1
vote
1answer
28 views

Using createLayer in CartoDB isn't working

So, the scenario is I have a situation where users can look up multiple tables worth of data, and want to view them in an aggregate fashion. Based on certain filters, I get a list of tables then want ...
1
vote
3answers
231 views

Load a really big geojson to a feature layer in leaflet

I have this geojson file(about 60mB) that contains the administrative area boundaries. I want to make a chloropleth and give color based on each geometry properties value and add it to the ...
1
vote
1answer
183 views

Add multiple strokes to Leaflet geojson feature path

Wondering if it's possible to add multiple strokes to a polygon or line feature (the same thing could apply to multiple fills for polygons too). The leaflet documentation on the L.Path style options ...
0
votes
0answers
13 views

Leaflet renders big lines

On opening the page i get this type of view.The lines are very thick. On clicking anywhere in the map it changes to 2nd picture.I am not being able to figure out why this is happening.
1
vote
1answer
13 views

Show html page(from different file) inside a leafleat marker

I am developing a web application and I would like to be able to show a full web page inside an L.marker popup window with fixed size... Until now I figured out how to run some php or html in the ...
0
votes
2answers
22 views

Leaflet: Change displayed column on click

I have a GeoJSON layer in a Leaflet map showing buildings. The columns of the buildings layer contain electricity usage info by date (eg., the column 12052015 contains electricity usage on Dec 5, 2015)...
1
vote
1answer
235 views

Leaflet popups events through CartoDB

How I can use the leaflet popups events throught CartoDB. I have seen that some events are working like 'click', 'movestart',but 'popupclose' and 'popupopen' are not working. My goal is to do some ...
0
votes
1answer
248 views

Using Leaflet: How do I get it to display one popup based on a condition?

Using Leaflet: How do I get it to display one popup based on a condition. See below. basemap_0.addTo(map); var layerOrder=new Array(); function pop_thunder(feature, layer) { ...
0
votes
1answer
57 views

esri-leaflet edit multiple featureLayers

I'm trying to use the esri-leaflet example on editing (https://esri.github.io/esri-leaflet/examples/editing.html) to edit two different featureLayers. First when I add a point with leaflet draw, I ...
2
votes
1answer
48 views

How a draw a circle (on the surface of earth) on a mercator projection?

I would like to use R and leaflet to draw a circle (a real circle on the surface of the earth) on a mercator projection. In the following code, I have the center of the circle (with lng=0 and lat=60),...
0
votes
3answers
528 views

How to load geojson from geoserver to define a variable in leaflet?

How can I load a geojson file from geoserver in leafletjs? There are lot of suggestions out there, but none of them work for me. Currently my app loads a js file from the server that starts like this:...
2
votes
2answers
55 views

Create map using Leaflet and JSON

I have a question in order to developing a web app using dynamic maps with JSON files. I'm using Visual Studio 2015 with MVC 5. At this moment i have developed complete app but I'm unable to draw ...
0
votes
1answer
1k views

Bootstrap navbar and leaflet zoom controls

I'm using the THE MAP GUY(DE) Bootstrap temple and applying it to leaflet using the code below. The issue I'm having is that the zoom-control doesn't toggle right on page load. It will only after ...
1
vote
1answer
22 views

How to add custom CSS class to leaflet tilelayer

I am working with mapbox.js and leaflet to create a map with a number of overlapping tilelayers. I want to apply some custom CSS to only selected tilelayers, and thus assign these layers to an ...
0
votes
0answers
73 views

How to get number of pixels between two points

I am working with the simple app which is using leaflet plugins.... I want to get the number of pixels when i draw a poly-line on map(from one point to another using poly-lines).... Actually i don't ...
3
votes
1answer
419 views

Leaflet.label and MarkerCluster problem with zoom dependent add/remove layers

Here's the setup: I have a leaflet map with point data, to which I have applied leaflet.label and leaflet.markercluster. I add the clustered point data at a particular zoom level (code below). All ...
2
votes
2answers
87 views

Download data from webmap made with leaflet

Can I download the data from a webmap made available from leaflet? I am referring to these dataset (https://www.vectorbase.org/popbio/map/), for which I wish to download the data for Europe? Is there ...
1
vote
0answers
166 views

Cant' get the correct measurements : LeafLet

i am working with the simple app Beta Here The application is using leaflet plugins/api.... User draw a line(poly-line) on the map/image and then enter the distance between two points.... Working ...