Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
2 votes
4 answers
2k views

Leaflet is behaving unexpectedly when trying to load more than one layer

I had a hard time trying to create a good title for my issue since it is a little hard to explain. But I will do my best. I'm trying to create a web map to show three distinct layers, each from a ...
user avatar
0 votes
3 answers
2k views

Turf.js only with Mapbox.js?

After trying turf.js with plain ole leaflet and getting confused because the most basic stuff wouldn't work, I'm thinking that turf.js requires Mapbox.js and access token. Can anyone confirm or deny ...
user avatar
  • 1,344
0 votes
1 answer
2k views

Which map API to draw polygon and export my data that is within boundary?

I have 5 point datasets that I want to display and be able to filter by fields. I will then be able to hand draw a polygon and export Excel of the data from each dataset within the polygon. Which web ...
user avatar
  • 337
0 votes
1 answer
300 views

understanding the use of the "_.[method call?] syntax in Leaflet

I have been using Leaflet as of late and enjoy the "lightness" of this API vs. OpenLayers. One of the things I am doing is looking at examples and/or source code from pages that use this API. I ...
user avatar
2 votes
1 answer
1k views

Get WMS info with Leaflet

I am trying to export (Excel, XML or PDF formats) WMS feature information using the following tools: 1.- GeoServer.-Provides a SQL statement which generates a WMS layer, based on polygon data. 2.- ...
user avatar
  • 177
1 vote
1 answer
650 views

Tools for map animations

I am preparing some visualizations of data (mainly animated choropleths), and I am looking for suitable tools. Ideally, I am looking for something similar to this kind of animated infographics. So, I ...
user avatar
  • 147
2 votes
1 answer
1k 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 ...
user avatar
  • 31
1 vote
0 answers
450 views

How do you filter mapbox layers?

I have 6 layers that contain grid, feature, and tile layers. var layers = [{ name: 'basemap', minZoom: 0, maxZoom: 19, layer: L.layerGroup([ L.mapbox....
user avatar
  • 73
0 votes
1 answer
291 views

Leaflet popups only displays columns where cell information NOT NULL? [closed]

I've got the following map on JSFiddle. The popup information comes from an Arcgis Server with 23 columns. When you click around the markers you can see that most of the popup information are not ...
user avatar
  • 1,068
2 votes
1 answer
1k views

Leaflet adding a HTML label

I would like to add a HTML label above each marker in a leaflet map. Is this possible? Example: Code for labels: HTML <table> <tr> <td class="red"></td> ...
user avatar
  • 3,500
0 votes
1 answer
197 views

Leaflet popups with source's special characters

I've got a map where I integrate spatial point data from an ArcGIS Server. Now I want a popup triggered via a click on the point. I know how everything works and the popup is displayed. But I've got ...
user avatar
  • 1,068
3 votes
0 answers
723 views

Leaflet filtering existing featuregroup

I have a leftleat map and i would like to filter the featuregroup i am displaying. exp_colJSON = new L.geoJson(exp_col,{ onEachFeature: pop_col, pointToLayer: function (feature, latlng) { ...
user avatar
  • 3,500
3 votes
2 answers
1k views

Leaflet - Hiding labels when any popup window is shown?

I am new to Leaflet and have found the following solution to add static labels to features in my map: L.CircleMarker.include({ bindLabel: function (content, options) { if (!this._label || ...
user avatar
  • 3,500
10 votes
2 answers
26k views

Adding Leaflet legend?

I am trying to add a legend to my leaflet map and no matter what I try I cannot get it to display properly. I have imported a point level geojson into my map and I have styled the points in a similar ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 19
2 votes
3 answers
16k views

How to export to all points within Leaflet polygon?

Is it possible to export all points within a polygon drawn using Leaflet? (http://leaflet.github.io/Leaflet.draw/).
user avatar
0 votes
2 answers
10k views

How do I json_encode without those quotes for the coordinates in leaflet geojson polygon?

I have a field name: 'coordinates' I have the coordinates stored in there: like this: [[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]] when I json_encode($geojson); I get ...
user avatar
8 votes
1 answer
9k views

Enabling all layers by default using Leaflet?

I am using leaflet maps to compare heat layer and marker layer. I've an option to add multiple marker and heat layers dynamically. For me Heat layers are enabled by default as on when user adds new ...
user avatar
0 votes
1 answer
813 views

Help binding Dynamic Map Layer popup in Esri Leaflet?

I've been experimenting with a web map using Esri Leaflet examples and I've run into a bit of a problem getting my popups to load. I'm able to successfully load the data from the REST service and it ...
user avatar
8 votes
3 answers
3k views

Great circles in QGIS and export in 3857 web map

My plan is to visualize great circles in a Leaflet web map. So coming from this great postgis article and R version I thought it would work like this in QGIS: create a line from two points, store ...
user avatar
  • 2,534
3 votes
1 answer
765 views

Preventing map panning to last drawn marker using Leaflet?

I have a basic Leaflet map where I need to draw several markers and lines on. How do I prevent the map from panning to the last drawn object? I've read about setting autopan : False for popups from ...
user avatar
  • 987
1 vote
2 answers
2k views

Json not loading from GeoServer into Leaflet?

I'm creating an web map application using Geoserver and Leaflet. I'm trying to load a few Json feature through an WFS service.The problem is that nothing is being displayed on the final map, the ...
user avatar
1 vote
1 answer
545 views

How do I toggle a legend of a cartodb layer in a leaflet map?

Per my previous question - here - how do I get the legend to toggle (I have it turned off now) in conjunction with toggling the cartodb layer via the leaflet layer control? Maybe adding it as a ...
user avatar
  • 448
1 vote
1 answer
3k views

Showing only ONE layer from group layer in Leaflet? [closed]

I have the following code to solve my workflow. But it does not work properly. The problem of the map behaviour appears to be within the map.getZoom function at the end of the code. That function ...
user avatar
  • 1,068
0 votes
1 answer
795 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 ...
user avatar
  • 448
5 votes
2 answers
21k 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 ...
user avatar
6 votes
2 answers
18k 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 ...
user avatar
1 vote
3 answers
3k views

How to load geojson vector tiles from mapbox id?

I have some data hosted on mapbox and I'm trying to load it as tiled geojson into Leaflet from its mapbox id (I just want to get plain geojson, I'm not trying to render it). How can I achieved that? ...
user avatar
0 votes
1 answer
12k 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', ...
user avatar
3 votes
1 answer
1k 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": {"type":"MultiPolygon","...
user avatar
  • 173
2 votes
1 answer
3k views

Adding comments using leaflet draw

I am working on an application that will leverage the leaflet draw plugin so that a user can open my map and drop comments in the form of markers. Then the user can click submit and it will serve me ...
user avatar
3 votes
1 answer
16k 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 standard leaflet ...
user avatar
  • 91
4 votes
2 answers
241 views

Batch create Leaflet webmaps in QGIS

During a project on the spider fauna of Greece, we have to face the design of distribution maps of the species. A good tool to work with is the design of Leaflet webmaps to be used on the website ...
user avatar
1 vote
1 answer
2k views

Comparing several Overlay Layers with Base Layer in Leaflet?

I write web app for comparing several Overlay Layers (in example OSM tile layers) with Base Layer (in example Bing Aerial layer) in Leaflet. It's work in 'first loaded' level zoom. But when I 'zoomIn'...
user avatar
  • 3,483
2 votes
1 answer
6k views

Hide/Show route layer in Leaflet when click on button (Easy Button plugin)

I have a Leaflet map with button (Easy Button plugin https://github.com/CliffCloud/Leaflet.EasyButton). When click on button on map added route layer (plugin https://github.com/perliedman/leaflet-...
user avatar
  • 3,483
2 votes
1 answer
273 views

CartoDB SQL and returning values

Right I've got this JS function function AreaCompare(sql, UIDfield, Geogname, Table, sourceName, sourceID, destName, destID){ CompareObj = {}; CompareObj.sName = sourceName; ...
user avatar
1 vote
1 answer
772 views

How to create and serve map tiles?

I have shapefile which is too large to be served as vector. Also, I need it only as background tile, not as layer with attributes. I thought of creating tiles in MapTiler as I already bought it. I ...
user avatar
  • 4,942
1 vote
1 answer
1k views

Is the data supplied to Google Maps or leaflet.js javascript rest API is private

I have a dataset which has to be used for internal/intranet web application. Is the data supplied to google map javascript api to draw map as well as to show meta information through markers is ...
user avatar
2 votes
1 answer
3k views

Add svg filter to paths created by leaflet?

If I were to create a simple inline svg, I could modify paths to have a drop shadow or a blur by creating a <filter> within a <defs> grouping. However, Leaflet dynamically generates the ...
user avatar
  • 475
16 votes
1 answer
81k views

Adding a search box to a Leaflet.js example

Consider the example in the following link for Folium: US Employment visualization per county. The result looks like what you see below:     I would like to add a search box to it to be ...
user avatar
13 votes
2 answers
29k views

How to switch base layer programmatically in MapBox/Leaflet

I have multiple base layers, and need to switch them programmatically, dependent on various actions and states in my application. Can't find how, for the life of me.
user avatar
  • 261
1 vote
1 answer
9k views

Changing marker size by zoom in Leaflet?

I get stuck with changing my marker's size when zoom changes in my Leaflet code. It's a simple map with a metro stations overlay coming from an ArcGIS Server. The markers are coming from that same ...
user avatar
  • 1,068
0 votes
3 answers
847 views

Get basic image/utf grid tile URLs from CartoDB visualization?

I'd like to add the layers from a CartoDB visualization to a Leaflet map directly (NOT through CartoDB.js). My visualization has one image tile layer generated from data, and one utf grid tile layer ...
user avatar
  • 151
11 votes
2 answers
18k views

How to add Geoserver WFS to Leaflet JS Application

I have a PostGIS database and have successfully consumed a table into GeoServer and published a WFS. Are there REST endpoints available for these WFS' akin to ESRI's feature services? How are ...
user avatar
0 votes
1 answer
257 views

The ordering of layers with CartoDB/Leaflet [closed]

Just want to get a bit of clarity about this query from before: Layer order in CartoDB I have a map with a Basemap and I want to draw points between features based on layer featureclicks, The good ...
user avatar
2 votes
0 answers
1k views

Load Maperitive's tiles.json into HTML for getting bounding parameters

I've created a local tileset of a city in Maperitive, and a basic leaflet.js webpage to browse it offline. There's a tiles.json also created by Maperitives that has all the essential bounding and zoom ...
user avatar
  • 911
1 vote
2 answers
216 views

Most efficient method to get national-level data displayed with Leaflet

I'm looking for the most efficient way to get a national or U.S. and Canada level dataset working with a JS mapping library. My problem is there's a myriad of technologies that seem like they can work....
user avatar
2 votes
2 answers
1k views

Showing link for every city at different zoom levels using Leaflet?

I have a Leaflet map that I am using to render a map of the U.S. The map will have specific zoom levels. For example, when the map first loads it will show major U.S. cities. Then if you zoom in it ...
user avatar
  • 121
4 votes
1 answer
1k views

d3 + Leaflet apply class value from geojson data

I have a geojson file that I'm able to draw just fine with D3 + Leaflet. I'm having trouble applying a class to the svg objects with a value from the geojson file. Each feature in the geojson file has ...
user avatar
  • 1,349
0 votes
1 answer
236 views

Changing cartodb.createLayer source

I'm applying a Carto named map layer to an existing Leaflet map similar to: cartodb.createLayer(map,{ type: 'namedmap', user_name: **username**, options: { named_map: { ...
user avatar
  • 245

1
63 64
65
66 67
77