1
vote
1answer
19 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
74 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
28 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
34 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
33 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
17 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
24 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
50 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
52 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
37 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
34 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
53 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
33 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
63 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
179 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
66 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
55 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
76 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
87 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 ...
1
vote
1answer
107 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
35 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
93 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
93 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
42 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
1answer
165 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
53 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
76 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
45 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
172 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
243 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
175 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
51 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
66 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
89 views

Leaflet toGeoJSON() keep leaflet_id

When I use the function .toGeoJSON(); is there way to keep the layer leaflet_id?
5
votes
6answers
1k views

3D perspective on maps in Leaflet, CartoDB?

Are there any JS library out there that would render normal, flat maps (like Leaflet) into a perspective map like this one, on the web: Also, anyone seen anything that could turn CartoDB data into ...
0
votes
0answers
90 views

Updating Mapbox map to newest API/getting markers to load

I'm new to the Mapbox API (and to Javascript in general), so please bear with me. I am trying to build an interactive map that automatically cycles through map markers as the user scrolls through ...
5
votes
1answer
939 views

Trigger a click event on a leaflet map?

Is it possible to make a click event occur at a particular lat/lon on a leaflet map? I would like to make a popup appear that is associated with a point at a particular location. I have tried several ...
1
vote
1answer
461 views

Unable to get Mapbox leaflet-omnivore to load markers from .csv

I'm using the Mapbox.js API to build a really simple web map using a .csv file to place markers with tooltips. I'm trying to use the suggested leaflet-omnivore library to easily parse the csv and ...
1
vote
1answer
293 views

Leaflet JS calling animatedMarker.stop() from event listener

I'm using the animated marker plug-in for Leaflet JS and would like to stop the marker from animating when it reaches a certain lat lon position. Currently I'm using Leaflet's 'move' event listener ...
2
votes
1answer
158 views

How to get data from TileMill tileLayer properties in Mapbox for click/hover

I've successfully used Leaflet to load a geoJSON polygon-shapefile with data, and added click and hover interactivity to the layer. For a large dataset, I switched to mapbox.js 1.6.1, used TileMill to ...
0
votes
0answers
38 views

What are some ways to put points on a map and information about those points in a sidebar?

I'm trying to figure out the best way to have a sidebar that will have information about points on a map (like you see in something like yelp). I can get the points on the map but I'm struggling to ...
0
votes
0answers
32 views

How to realize two overlaying layers? One with Popups, the other one with Info-div!

I'm trying to display two overlaying layers (geojson). Layer1 should give me information by hovering over it (works fine based on the Leaflet Choropleth Map Example. Layer2 is situated within Layer1 ...
1
vote
1answer
255 views

Leaflet setView with non lat/long CRS

Is it possible to use setView when using an alternative CRS? var map = L.map('map',{crs: L.CRS.EPSG26915}).setView([4970081,477018], 13); // Returns: Uncaught TypeError: Cannot call method ...
8
votes
1answer
174 views

Mercator bias plot in Leaflet

I was inspired by this wikipedia image from the mercator projections page to hack around with leaflet. The idea was to interactively have your cursor move a continent and that it would be corrected ...
3
votes
2answers
89 views

How to display information in a div outside the map?

I tried a bit around and created a simple map with two polygons(most of the code I got from the Interactive Choropleth Map Tutorial). I added a "L.control()" to show information about the polygons in ...
3
votes
1answer
216 views

leaflet choropleth map using dynamic value

I am doing a choropleth map using leaflet and JSON data. I got a clean tutorial in leaflet site. In that tutorial the used us-states.js JSON file where the choropleth was based on the ...
0
votes
1answer
231 views

Mapbox markerLayer from GeoJSON with prompt as input not working

I am trying to display a pin on a map. It works fine if I code the GeoJSON data into the script of my file. If I try to insert the GeoJSON data via a user prompt, it doesn't work. The variable must be ...
2
votes
1answer
60 views

Why aren't my basemap tiles showing up via ArcGIS Server

I have a leaflet js script referencing the ArcGIS server imagery api. The code worked fine up until about two days ago. Now when I click on the layer there's a gray background. I am using my local ...
0
votes
1answer
99 views

How can I extend L.mapbox.legendControl?

I'm trying to override legendControl.onAdd, but I can't seem to do it early enough. I can override the other functions, since they're fired after map init, but I can't seem to change the prototype? ...
0
votes
1answer
56 views

How to call Leaflet FullScreen plug-in from code

I'm currently using Leaflet along with leaflet.fullscreen to provide a full screen map. I've got it working nicely with the button but I can't work out how to "call" the function manually from my ...