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

learn more… | top users | synonyms (1)

0
votes
1answer
521 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 ...
0
votes
1answer
10 views

How to set bounds and make map bounce back if moved away?

I wanna make this map bounces to the center, and make the red line the limit that you can move the map. Don't know why my fitbounds doesn't work. Any help? My code: var mapBounds = ...
1
vote
0answers
11 views

Snap polygon to grid (lat/lon)

I'm trying to code this in Leaflet, but the key is finding the formula to do this. Give a polygon (filled in the image), how can I expand it to fit a grid (lat/lon, outer line in image) ? This is ...
0
votes
1answer
30 views

How to show/hide markers that are inside a function using js?

I have a map with a lot of markers that are pulled from this function: function showResourcesByName(name) { for (var i = 0; i < markers.resources.length; i++) { var resName = ...
14
votes
4answers
28k views

How to show a popup on mouse-over, not on click?

Is it possible in Leaflet that popup opens on mouse-over, not on click? This is working for just one marker at a time, but I need it for a bigger number of markers: marker.on('mouseover', ...
0
votes
0answers
14 views

Geosearch esri controls in leaflet

It is possible to disable the Geosearch esri controls in leaflet after the first geocode search?.When i run chrome console and i select the search geocode icon this is the code: <input ...
4
votes
3answers
275 views

Heatmaps: right terms (isopleth vs choropleth, etc) and how to implement a value-based one that looks good?

NOTE: My original question was about interpolation methods, but I've found that I was actually asking the wrong question. Interpolation methods with Heatmaps and IDW are the least of my problems right ...
1
vote
2answers
111 views

Separating two GeoJSON files, one with properties and another with geometry?

Using Leaflet with GeoJSON, I would like to create a map with geometries, and with alphanumerical data associated to each item of the geometry. A map very similar to the easy sample at ...
1
vote
1answer
159 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: ...
2
votes
1answer
703 views

how to draw a polygon in leaflet and add it to geojson file

I am working on a small project with leaflet. the goal of the project is to show a geojson file and updating it dynamicaly from the window of the web site. I have imported the geojson file to the map. ...
1
vote
2answers
43 views

Leaflet TypeError: this._northEast is undefined

I have some codes used Leaflet and I want to refactor them below one is working: jQuery(document).ready(function(){ $.post("StatisticsResultServlet", { ...
2
votes
0answers
30 views

Map not rendering at zoom level 18+ using openlayers3 and leaflet

I've configured an OSM map server with mod_tile/renderd/postgres to display a basic map and everything works fine until I try to zoom into level 18 or more. At any zoom level less than 18, I can see ...
1
vote
1answer
45 views

Leaflet, customizing the layerswitcher [on hold]

So i recently decided to switch my project from Openlayers 3 to Leaflet, mainly because i needed the layer switcher control. I followed the example on the leaflet tutorial, this one to be precise and ...
2
votes
0answers
13 views

How to identify WMS layers on click

I need to add interactivity to several WMS layers using leaflet, the problem i have is how i can identify what layer the user is clicking, i usually use geojson for this and is easy, but for WMS ...
2
votes
0answers
27 views

R: Setting pop-ups dependent on zoom level using leaflet

I have data that I would like to group differently, depending on the zoom scale in an interactive map made using leaflet. I have expenditure data and I would like to show expenditure by lake at ...
0
votes
1answer
32 views

Speeding up large GeoJSONs in Leaflet maps

I've been racking my head around this problem for some time and I could use some help; I am trying to use Leaflet to make a map which displays multiple projection boundaries, i.e. UTM, State Plane, ...
1
vote
1answer
58 views

z-index of geoJSONs and imageOverlays in Leaflet

There have been several Github issues raised regarding Leaflet z-indexing of layers, and I'm still not clear where things stand. I think my question is quite simple: Is it possible to set any ...
3
votes
1answer
36 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, ...
2
votes
1answer
23 views

Displaying colored traces and waypoints

Goal: display map with few routes, which have colored segments. Also displays few waypoints with text + gives option to download few gpx routes and additional text. I see that gpx format has ...
1
vote
1answer
149 views

Field Collection App for Geoserver or Any OS GIS Server [closed]

I am looking for a mobile app/interface for field data collection and mobile editing of GIS data that relies/syncs back to some type of GIS server or database. I am aware of Fulcrum and AmigoCloud, ...
1
vote
2answers
545 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 ...
1
vote
0answers
33 views

Tilestache Vector Tiles with Leaflet [closed]

I've set up a tilestache server and I am displaying vector tiles from the service using leaflet and the leaflet-tilelayer-geojson script from: ...
0
votes
2answers
29 views

Make a leaflet TileLayer appear above a GeoJSON layer

I'm trying to add a layer of place labels above a GeoJSON layer, so that these labels remain visible. However when I add the layer per the code below, the tileLayer remains below the GeoJSON layer. ...
1
vote
1answer
29 views

Problems with simple Leaflet + Mapbox TitleLayer?

I'm completely new to GIS, and thought I would start off with the leaflet quick tutorial. However, I'm having problems with adding the base tile layer with Mapbox. This is my code so far: ...
0
votes
1answer
38 views

Leaflet + GeoJSON and ArcMap : Map fails to load if missing variable

I am working on my first web map using the Leaflet API. I have a shapefile that was converted to the GeoJSON format (within ESRI's ArcMap software). The Shapefile contains a field attribute named ...
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
26 views

Leaflet: Change icon inside a function

I have a custom function that pulls the markers from a json file called markers.json : var markers = { "resources": [ { "name": "AITokarServer", "coords": [ { "x": ...
0
votes
3answers
298 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 ...
3
votes
1answer
23 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
2answers
40 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 ...
1
vote
1answer
664 views

How to let the user resize a Leaflet map <div>

I use Leaflet to display some map. I would like the user to be able to resize the map by dragging its borders as she likes. I would like to do this without additional Javascript libraries, instead by ...
2
votes
1answer
169 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": ...
1
vote
0answers
179 views

How to add GeoJSON layer with GraphHopper?

I have a GeoJSON file containing some POI that I would like to be able to display within a separate layer with GraphHopper. But after several tries and search over internet, i can't manage to get a ...
1
vote
1answer
613 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 ...
1
vote
1answer
38 views

Stubborn geojson layer misaligned with mapbox (leaflet) tiles only in production website, not in codepen or other online sandboxes

You can see my code and expected result in this running swiftly in codepen! Other online sandboxes work as expected too. The exact same code running in my php file on my wordpress site, shows the ...
1
vote
1answer
186 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 ...
1
vote
1answer
37 views

hide unhide layers in leaflet

I want to hide somme layers when I click in a layer and resotore the visibility back after clicking out I tried with this code but it doesn't work here also the punker code Hide show layers var ...
1
vote
1answer
260 views

Leaflet: how can I update content of popup by jQuery

in my popup is a spinner with class=spinner and an empty container for addon informations. I want to hide after successful ajax. I want to add some html in a container. I tried this: ~~~ ...
1
vote
2answers
33 views

In a webgis using leaflet, how to export maps as pdf?

Like the title says, I'm building a webgis using Leaflet. I want to allow users to export maps from the website and download them, but the current downloaded format is shapefile. I wonder if there's a ...
0
votes
1answer
23 views

Geoserver wms reflect zoom level

I am trying to get a Geoserver wms request using reflect option as static layer to embed into a webpage through a url like this: ...
2
votes
1answer
250 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 ...
1
vote
1answer
171 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 ...
2
votes
1answer
23 views

Mutually Exclusive Bootstrap Checkbox Switches as Layer Control

I have this JSFiddle with two checkboxes using Bootstrap Switch that change the layer visibility in Leaflet. I would like them to be mutually exclusive, i.e neither of them can be on or off at the ...
0
votes
1answer
179 views

Leaflet: Find my “this” in GeoJSON.pointToLayer function

In leaflet, I have a class that extends L.GeoJSON: L.MyLayer = L.GeoJSON.extend ({ initialize: function () { this.markers = []; ... I redefined the pointToLayer method to create ...
0
votes
1answer
46 views

GeoJSON properties not displaying in popup-leaflet GeoDjango

I want to show the markers in different colours based on column(rastervalues) values in leaflet. My geojson data is {'geojson': "[{'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'ge ...
0
votes
1answer
29 views

Change Bootstrap Switch Depending on Leaflet Layer Zoom

I have this JSFiddle that as you can see has two tile layers. I have set the minZoom of the 'Example Layer' to 5 so that it only loads once you have zoomed in that far. The issue is, using Bootstrap ...
1
vote
0answers
37 views

Using Leaflet and Web Map Tile Service (WMTS)

I'm trying to use an API for rendering tiles with a Leaflet map. A link to the API looks like this and I think that the format is WMTS: ...
1
vote
1answer
290 views

Rendering TopoJSON in Leaflet from GeoJSON PostGIS output?

I'm using the query found here SQL query to have a complete geojson feature from PostGIS to get a geojson that I can display on a leaflet map. However, the amount of data is kinda big and the ...
1
vote
2answers
505 views

How to open a popup on Marker click when Markers are in array using leaflet maps

Hey guys I have a set of Markers that are getting created dynamically on a .each loops like so. $.each(data, function(index, element) { markerArr[element.id] = ...
0
votes
2answers
924 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/).