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

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Leaflet drag scrolling on mobile

My leaflet map is between a navigation bar and a chart displayed underneath. Unfortunately after recently incorporating leaflet-1.0-beta-2 my responsive layout is not working out on mobile devices ...
1
vote
0answers
16 views

Using Google Streetview with Leaflet

I'm pretty new to leaflet and I'm trying to figure out how to use Google Streetview with Leaflet. What I would like to have is the Google pegman in the right bottom of my map so that I can click and ...
0
votes
0answers
13 views

Adding additional markup to leaflet marker_

I'm trying to customize the html output for my leaflet markers. Specifically, I'm trying to assign them additional data attributes to trigger bootstrap modals based on an ID pulled from the database ...
0
votes
0answers
4 views

How do I get the information in the callback of a contextmenu which marker was clicked

I have a leaflet map with markers. For the contextmenu of the marker i use this plugin https://github.com/aratcliffe/Leaflet.contextmenu When I rightclick on the marker and choose an option of the ...
1
vote
1answer
31 views

Problems with case statements in Leaflet's pointToLayer

I am trying to create a layer that has different types of business (separated by code properties in the geojson file) but when it executes the pointToLayer below I get an Uncaught TypeError: Cannot ...
0
votes
1answer
28 views

Leaflet/GeoJSON - Changing the default blue marker to other .png files

How can I use different .png files to symbolize my GeoJSON data? I have one property in my GeoJSON file that I would like to symbolize the data by (feature.properties.issue). For each different issue ...
2
votes
1answer
19 views

How to remove a single marker in Mapbox?

I have a simple Marker added to map like this: var x = L.marker([50.5, 30.5]); x.addTo(map); Now how can I hide/remove x? I searched the API docs for a Marker.remove() method, but couldn't find any. ...
2
votes
2answers
41 views

Leaflet/HTML/GeoJSON: How to put a pop-up on a geoJSON point?

I don't have much knowledge of HTML/JS/GeoJSON, and have made a webmap from trial and error with many different tutorials. I have tried leaflet's tutorials but cannot get the desired results. I have ...
0
votes
1answer
24 views

Leaflet OSM Geocoder not working

Maybe this sounds a silly question but the leaflet OSM Geocoder published here Leaflet Control Geocoder doesn't work for me. I can see the search bar but when I search something, nothing happens. The ...
0
votes
1answer
16 views

Leaflet Customer Marker Changes Position with Scale

I am using a customer marker to represent metro stops in my leaflet map. The problem is that the markers are changing their position every time I zoom in or out. When I finally zoom in to the last ...
1
vote
0answers
13 views

UTFGrid and line features: UTFGrid not consistently triggering mouse events for line features

[Update: My first solution works (notes below), but I'm still interested in responses to the second solution I suggested.] Original Post: Has anyone experienced and resolved difficulties with ...
2
votes
1answer
25 views

Leaflet Map not Visible

I try to make my first Leaflet webmap (I'm very new to JavaScript so please ignore the dirty & repetitive code). I want layer controls and read the Leaflet layer control example but somehow my map ...
0
votes
1answer
24 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
2answers
40 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
38 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 ...
2
votes
1answer
18 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
37 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
47 views

Leaflet, customizing the layerswitcher [closed]

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 ...
1
vote
2answers
52 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", { ...
0
votes
1answer
39 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, ...
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, ...
1
vote
1answer
61 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 ...
1
vote
1answer
30 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
2answers
30 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. ...
0
votes
1answer
34 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 = ...
2
votes
0answers
28 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 ...
1
vote
0answers
35 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: ...
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 ...
1
vote
1answer
27 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": ...
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
40 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 ...
2
votes
1answer
25 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 ...
1
vote
0answers
41 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: ...
0
votes
1answer
30 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 ...
0
votes
1answer
53 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
24 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: ...
0
votes
1answer
37 views

WMS getFeatureInfo and Leaflet

I've got an app running www.carstenhogertz.de/c_section. It has a popUp function showing the underlaying point attribute. This function shows a strange behaviour on lower zoom levels. For instance ...
1
vote
0answers
14 views

Customize QGIS Leaflet webpage [closed]

I created a webpage QGIS map using the Leaflet plugins, how to customize , put mouse over, then features will zoom automatically while you mouse on click on the map features, and also automatically ...
2
votes
0answers
57 views

Mapbox GL Leaflet interaction

I've built a map in Leaflet which has a really large GeoJSON file. Currently the only way I can get it to work is if I severely simplify the GeoJSON file down from 100mb to 25mb. I'm looking at using ...
1
vote
0answers
33 views

Popup not firing for all markers in leafletjs

I am using bindpopups to show a popup on a marker. This is a poc for showing markers on the map which has 2 markers at present but it seems like it fires only on one marker and not the second one. ...
1
vote
0answers
41 views

First click layer selector doesn't work in CartoDB?

I'm working on an interactive map using CartoDB built of Leaflet.js. I added a layer selector which works fine after the first click. The first click just doesn't work, if I click the selected layer ...
2
votes
1answer
25 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 ...
3
votes
2answers
42 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 ...
0
votes
1answer
59 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 ...
0
votes
0answers
16 views

Display leaflet tile layer correct using custom CRS with proj4leaflet

I use a custom CRS to show the map of the north pole. There is a framework called PolarMap.js (http://webmap.arcticconnect.org/) which does this correct. My custom CRS however does not show it the ...
2
votes
0answers
42 views

Removing individual markers from map

I have a map with several moving markers on it and have been trying to remove each individual one when their respective animation ends. I am using Leaflet and Leaflet's plugin Leaflet.MovingMarker. I ...
1
vote
2answers
43 views

Embed a (saved) Leaflet map in an Ioslides presentation

I'm building some fairly complex maps with the leaflet package and I'd like to embed them in an rmarkdown document (specifically an ioslides_presentation .Rmd file). Right now the code for the maps ...
1
vote
1answer
51 views

Leaflet marker cluster not working on GeoJSON with MultiPoint geometry

I have a GeoJSON file of fly tipping incidents that I have managed to display on a basic Leaflet map. I am now trying to incorporate the marker cluster plugin, but I am having problems as it does not ...
0
votes
0answers
52 views

Failed to load resource: the server responded with a status of 404 (Not Found) Django while displaying geojson data on map

I'm getting the following error when I try to diplay geojson data on map. http://localhost:8000/geojson/%7B%22type%22:%22Point%22,%22coordinates%22:[76.996944,31.58]%7D Failed to load resource: the ...
2
votes
0answers
53 views

Display GeoJSON data on map using django-leaflet?

I want to display GeoJSON data on map in geodjango. When I use the below code only GeoJSON data like: { "type": "FeatureCollection", "features": [{ "type": "Feature", ...