2
votes
0answers
24 views

find inner bounds of a polygon in leaflet

How can I find the inner bounds of a polygon in leaflet? I a want to plot points randomly in polygoon but when I say Layer.getBounds() I get the bounds and I can still plot the markers ...
2
votes
1answer
34 views

Saving Leaflet Maps in Database

I have a webpage with a Leaflet Map, I can add markers,filter markers and so on. My question is that how can I save it? Load the Map Add some Markers on the Map (Optional) Filter the Markers on ...
1
vote
0answers
12 views

How to use leaflet-plugins with typescript

I'm attempting to add a bing map layer and a google maps layer to my leaflet map. I am using the typescript type definitions for leaflet rather than the leaflet.js file. To add the layers, I was using ...
2
votes
0answers
19 views

Check/uncheck overlays in groupedlayercontrol.js

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image: Everything works well, but I need to uncheck certain layers, allowing the ...
1
vote
1answer
17 views

Update mouseover information with baselayerchange on leaflet map

On leaflet map I use baselayerchange in order to change the legend box and the info popup on rollover. The legend change works perfectly but I have a problem with the infobox (name info0/info1...), I ...
0
votes
0answers
7 views

Restrict legend to map bounds in CartoDB.js

Does anyone know how to restrict legend content based on map bounds in CartoDB.js? I am building a large, complicated legend and I would like it to only display visible features to reduce complexity. ...
1
vote
1answer
31 views

Leaflet - how do you get individual markers from a featurelayer?

In Leaflet, if I have a feature layer filled with markers, how do I get these markers back from the layer? I want to apply different popups to each individual marker, instead of the entire set. I ...
0
votes
0answers
19 views

Leaflet.EasyButton toggle

I am attempting to incorporate Leaflet.EasyButton into an application. While I am able to drop it in and call a function I would like it to toggle on/off. right now it is loading an inner.HTML div ...
0
votes
1answer
23 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. ...
1
vote
1answer
38 views

Custom ordering/z-index of icons in Leaflet layer

I have a single layer (points) with a bunch of markers. Each point has an attribute that is regularly updated. I understand by Leaflet sorts the layers such that those lower in latitude are on top for ...
2
votes
0answers
56 views

Comparing mapping APIs

I am planning to write a thesis about mapping APIs and compare three of them (Google Maps API, Leaflet and OpenLayers) or four, if you consider OL2 and OL3 as different APIs. I am planning to make 3 ...
1
vote
1answer
32 views

Leaflet: How do you use removeLayer?

This is driving me mad. See the Leaflet tutorial for adding a layer control to your map: L.Icon.Default.imagePath = "Scripts/images"; var mapUrl = ...
1
vote
1answer
51 views

How to update leaflet L.imageOverlay using jquery serialize without page refresh?

I am developing an application that fetches and displays raster/image maps (png, tif), into a leaflet map. However, I didn't like the page and the map refresh upon form submission. In addition, I ...
1
vote
0answers
32 views

Create a Leaflet custom checkbox control

I want to create a custom checkbox control which will simply set a flag in jquery/javascript: if checked the flag = 'clustered' or if unchecked flag = 'unclustered'. So far I have a control on the ...
0
votes
0answers
27 views

Unable to identify the colours on leaflet

var non_tfl_lines_JubileetoIlford = L.geoJson(non_tfl_lines_JubileetoIlford, { pointToLayer: function(feature, latlng) { switch (feature.geometry.type) { case 'LineString': return new ...
0
votes
0answers
41 views

Run-time substitution on MapServer with Leaflet

I have a MapServer instance and map file displaying data in selected countries using a Leaflet WMS tileLayer. This map file works to display points from a single country (showing the LAYER definition ...
1
vote
1answer
79 views

Adding popup to geojson layer based on feature property?

I'm using leaflet and trying to add a popup to a point on the map that will return a property of the point from the geojson file. Going off this post has been helpful problem adding pop-up to GeoJSON ...
4
votes
1answer
130 views

*Leaflet* mouse wheel zoom only after click on map

I'm working with the Leaflet JavaScript Library and attached a (working) map to my HTML Document. It is in the middle of the page, and when I'm scrolling down with my mouse wheel and arrive at the ...
2
votes
1answer
54 views

Display a link in a popup with Leaflet

Hey there! Im working with the Leaflet javascript library. There should be an option to click on my map and view a popup. I already have a code for that: var popup = L.popup(); function ...
1
vote
2answers
138 views

How to style geojson polygon using L.mapbox.featureLayer()

I have this code: var SupIncend = L.mapbox.featureLayer().addTo(map); var ArbolesAntes = L.mapbox.featureLayer().addTo(map); var ArbolesX = L.mapbox.featureLayer().addTo(map); var ...
1
vote
0answers
54 views

Multiple Leaflet maps on website in different divs

I'm pretty new to leaflet.js and I'm trying to figure out how to assign the same map with the same set of options and layers to a different HTML container instead of having to remove and add a new one ...
1
vote
0answers
24 views

Leaflet: Is there a way to use click event just like mouseout?

I made a map with leaflet by following the official Leaflet tutorial on interactive choropleth maps. I would like to make the map compatible with smartphones, so I added a click event, which acts ...
1
vote
0answers
47 views

Callback method geocode items nominatim not work

function addr_search() { var inp = document.getElementById("addr"); $.getJSON('http://nominatim.openstreetmap.org/search?format=json&limit=5&q=' + inp.value, function(data) { ...
1
vote
1answer
107 views

Changing list-item css class using ng-class when mousing over Leaflet Map Markers

I've got a doozy of an ng-class problem. So I have an app with a map/markers on the right and a list-item menu on the left with info about the markers (like Yelp or Foursquare). With some of my ...
0
votes
0answers
119 views

How to create dynamic legend for multiply layers with leaflet.js?

I want to create multiple choropleth maps which displays different statistical data with leaflet.js. So it would be nice to show different legends for each map. I create such legends for two layers ...
1
vote
0answers
42 views

How to go about creating a custom tool/adding special functionality for a web app

In my soon to be developed web app, I will have an image service and also a feature service that is essentially an index to the image service, with all kinds of attributes. I would like for the user ...
0
votes
0answers
76 views

How to use different popup styles in the same leaflet web map for different dynamic map layers

I am very new to javascript, CSS and HTML. I have been playing around with leaflet and have been trying to figure out a way to customize popups for different features in my map. Is there a way to do ...
1
vote
0answers
82 views

How do I use Proj4Leaflet projections correctly?

I'm loading data layers from a WMS server into a Leaflet map, and I need to give the user a choice of projections. For the WMS server requests, I just need to change the CRS parameter to a different ...
2
votes
1answer
86 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
0
votes
0answers
73 views

Radius based search with Leaflet maps

Using leaflet I have created a simple map, played around with markers (adding/removing) and have added some GeoJSON data polygons etc. I now need help with implementing a radius search. For example I ...
5
votes
3answers
218 views

Guidance when to style your features in Tilemill vs. Leaflet?

I've found this generally to be dependent on each project's goals (or what the client wants), but when you have the options, what any rules of thumb or guidelines do use you in a project to determine ...
0
votes
1answer
102 views

Reproject WKT Polygon with Javascript

I have a polygon in WKT in EPSG:4326: polygonWKT = 'POLYGON((13.215179443359373 52.588032137196755,13.42803955078125 52.592620721000365,13.454132080078125 52.46897854656702,13.347015380859375 ...
0
votes
1answer
93 views

CartoDB or Leaflet.js get coordinates of point clicked?

Using CartoDB or Leaflet.js is it possible to retrieve the coordinates of the point on the map clicked when opening an infowindow?
1
vote
2answers
132 views

Leaflet highlight feature by ID

I have a map application where: I load polygons as GeoJSON objects I draw all polygons in a single layer I highlight a polygon on mouse hover What I need to do is the following: on mouse hover, I ...
1
vote
2answers
177 views

Adding multiple layers with timed delay in Mapbox/Leaflet

So I've got a Mapbox map showing data split into several layers. I'd like the user to be able to click a play button to call the function "gogogo", and then the layers get added one at a time every 1 ...
2
votes
1answer
196 views

Leaflet rendering TileMill tiles in the wrong order

I'm stumped, and quite a lot of searching has turned up nothing helpful. I'm on the first step of what will ultimately be a map with three raster layers and three layers of markers (with controls to ...
1
vote
0answers
51 views

Leaflet - Enable/Remove popup on mousedown/mouseup?

I'd like to do as the title suggests and can get the popup to appear on mousedown with the following code, but mouseup doesn't close the popup: // Quick look at info on mouse hold ...
0
votes
1answer
126 views

Leaflet Custom Control Fails

Why does the myMenu control not respond to a click? var map = L.map('map').setView([51.505, -0.09], 13); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: ...
4
votes
1answer
124 views

Show markers only at certain zoom levels

I'm building a cycle touring map in leaflet.js, with subjective information overlaid as markers, along the lines of "this is a great road", "this town is quite nice" etc. To avoid information ...
0
votes
0answers
60 views

Handling Popups in Leaflet with Overlapping Features

I am new to Leaflet as well as Javascript, and I'm looking for some advice on a basic topic. Currently, I am trying to create a spatial index of library holdings for old topographic maps that people ...
4
votes
2answers
199 views

Editing PostGIS topology in a web browser

I am trying to conceptualize the best process for editing topology from PostGIS in a web browser. Ideally what I would like to accomplish is the loading of a topology (imagine the lower 48 states of ...
0
votes
1answer
67 views

OpenLayers/Leaflet render world borders

I am trying to show all world borders. Either using OpenLayers or Leaflet. World borders are taken from here. This code does not work. What I am doing wrong? var Map = { map: null, layer: null, ...
1
vote
1answer
115 views

Opacity contrl for mapbox map with several layers

This is an example of how opacity can be changed for a Mapbox.JS map: https://www.mapbox.com/mapbox.js/example/v1.0.0/opacity/ The example shows only one layer used. With barely any experience in ...
0
votes
0answers
55 views

Leaflet JS - Polyline and getPopup

I would like to get the popup that was bound to a polyline but it seems that unlike marler objects, polyline do not have such method. Any suggestion ? Also, it seems that the 'popupopen' event is ...
1
vote
2answers
230 views

How to load big geo-data file into web application

I am building a web app where I show details in map. I load data using geojson file (190 mb). I was looking in different possibilities to show the data, here there are: Leaflet GeoJSon: it should ...
2
votes
1answer
345 views

Leaflet center Marker AND Popup on Map viewport

I want center my marker on popup open.. and centering map not in marker latlng, but on center of marker and popup! The problem is that popup has dinamic content(loaded on click). The map size is full ...
0
votes
2answers
236 views

How to add a floating “crosshairs” icon above leaflet map?

While reading the article about MapBox's map utility to searching for flight MH370, I noticed that they have a stationary "floating" target (or crosshairs) icon that helps users identify the center of ...
0
votes
1answer
58 views

Drop Marker with 3857 projection in leafletjs

Is it possible in leaflet to drop marker with 3857 projection on map? I fond a solution where first translate point to 4326 using proj4js and than drop it on map. var source = new ...
0
votes
0answers
84 views

set map center in leaflet with 3857 lat/lon

I'm trying to set map center with lat/lon of 3857 projection in leaflet. By using lat/lon of projection 4326 its working fine. var map = L.map('map', { crs: L.CRS.EPSG3857 ...
1
vote
0answers
123 views

Leaflet toGeoJSON() keep leaflet_id

When I use the function .toGeoJSON(); is there way to keep the layer leaflet_id?