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

learn more… | top users | synonyms (1)

4
votes
1answer
63 views

Trigger a layers 'on hover' effect through another layer in Leaflet

Im trying to make a map containing two separated basemaps one with terrain and second with labels, and with vector data layers in between. The problem is when I try use hover/click events on data ...
1
vote
0answers
43 views

Draw L.circle in a custom pane

I want to draw L.circle in a custom pane but I am using mapbox.js and hence the leaflet version 0.7.7. How can I draw L.circle in a custom pane? Do we have to copy some js files from the current ...
1
vote
1answer
39 views

Getting Node.appendChild error with leaflet

I am trying to add a popup function to some polygons. I've been consulting a few different tutorials trying to work it out and I'm concerned that I am getting conflicting instructions. The map I have ...
1
vote
1answer
57 views

LEAFLET - geojson properties in bounding box

Is there a way to show geojson properties which are located in current bounding box? something like this http://turbo87.github.io/leaflet-sidebar/examples/listing-markers.html with geojson and its ...
0
votes
1answer
22 views

Similar representation of flow using leaflet and its plugins for Polyline

Is there any javascript plugin of leaflet that can achieve that which are shown in the link? http://gmaps-samples-v3.googlecode.com/svn/trunk/symbols/polyline-symbols.html Is it as smooth as shown ...
1
vote
1answer
47 views

Converting json to geojson

I am writing a web service which in return gives json format data can anyone help me to convert this data into geojson format. { "STATE_ABBR": "AK", "file_name": "addresses", "AREA_WATER": ...
0
votes
1answer
65 views

Zoom to and Spiderfy MarkerClusterGroup, open popup of target marker

I am trying to zoom to a specific marker and open its popup using an external onclick event. To achieve this I need get the leaflet ID of the target marker, spiderfy the MarkerClusterGroup and call ...
1
vote
0answers
40 views

How do I create an attribute table in a web page from GeoServer using JavaScript?

I'm trying to create a custom web application using Leaflet and Geoserver. I've got my layers visible in a map viewer, but I'd also like to show an attribute table of the visible map layers. I can't ...
1
vote
0answers
42 views

Need to highlight required area using leaflet [closed]

I need to display a polygon and highlight a city, I added the link bellow https://nominatim.openstreetmap.org/search.php?q=Bambalapitiya&polygon=1&viewbox= as nominant search I need to ...
0
votes
0answers
51 views

“Cannot read property 'name' of undefined” in fuse.js / Leaflet-search.js

If I type the correct name and press enter, it takes me to the right place but does not show results below the search field as it should. Taking example form ...
2
votes
1answer
39 views

How can I load GeoJSON from URL to leaflet? [closed]

I want to use leaflet's L.GeoJSON to load the GeoJSON from my URL. I have tested to use leaflet-ajax plugin and it worked. The codes as follow: <link rel="stylesheet" ...
0
votes
1answer
47 views

Is it possible to edit draw panel in Leaflet Draw?

Can i edit leaflet draw panel by adding some new buttons? For example, i want two buttons for drawing polylines, three for markers and etc.
1
vote
1answer
42 views

How to access png tiles loaded in the browser

I've a local map server that renders mbtiles file in the browser and I'm trying to access the source files generated by it and loaded on the document. So far I've been able to get my hands on the ...
1
vote
1answer
82 views

Error with Leaflet Tutorial on adding Mapbox tile layer

I'm trying to add a Mapbox Classic base layer from my account using Leaflet's tutorial. I can't figure out what's wrong with my code: <div id='map' ></div> <script> var map = ...
-1
votes
1answer
24 views

using qq map tiles with the leaflet.js :Uncaught Error: No value provided for variable {x16}

I tried to use qq map tiles with the leaflet.js but it has an error "Uncaught Error: No value provided for variable {x16}" and cannot show map. My code var map = L.map('map'); ...
-1
votes
1answer
29 views

Problem loading specific WMS with leaflet

I try to add this WMS in a Leaflet map by using the L.tileLayer.wms. ...
3
votes
1answer
54 views

How do I get the bounds of a layerGroup in Leaflet?

I have added multiple geoJSON layers to my map by first adding them to a LayerGroup and then adding the layerGroup to the map. Now I want to call fitBounds on the map with the combined bounds of all ...
3
votes
4answers
66 views

Problem in ubuntu loading geoserver wms layer in local server with leaflet

I am just starting to work with geoserver. I am trying to do the same openlayers-geoserver example but using leaflet to view the map instead of openlayers: Publishing a shapefile This code is not ...
1
vote
1answer
63 views

How to use Leaflet's overlayadd event

In the example at http://jsfiddle.net/gwulo/w6cvagoL/4/ I'd like to force only one overlay to be visible. So if you select Cities2 in the layer switcher, the Cities1 overlay should be de-selected. ...
1
vote
1answer
33 views

Set view does not work after Fitbounds

I have a map and a layergroup. var map = L.map('map').setView([27.6758,85.3313], 12); L.tileLayer('http://{s}.tile.cloudmade.com/8ae544230be74379927e6dee5d416398/997/256/{z}/{x}/{y}.png', ...
4
votes
0answers
70 views

Thematic map exported using QGIS2Web is extremely laggy

I have made a world thematic map and added layers of data for creating graduated color scheme on the country level. I need a interactive map as an output which shows values when user hover over any ...
5
votes
2answers
109 views

How to render Multi-Response GeoJSON tiles

I am using TileStache to combine and server multiple vector layers in a single Mutli-Response GeoJSON tile, which is basically all my individual tiles/layers (GeoJSONs containing either roads, pois, ...
4
votes
2answers
104 views

How to convert non Web-Mercator coordinates to the tile Y, X, Z coordinates?

I just found that leafletjs and openlayers have two different conventions to convert coordinates from EPSG:4326 (WGS 84) to tile names ({Z}/{X}/{Y}). Thus I would like to have more information about ...
3
votes
3answers
69 views

Projection issues with Leaflet - polygon appears off

Using Leafletjs to upload coords from a json file as a polygon. The original coordinates are Vicgrid94(3111). I used QGIS to change the projection to LatLng (4326). When I load the points onto my ...
1
vote
0answers
45 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
25 views

Using Google Streetview with Leaflet [duplicate]

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
20 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
11 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
49 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
48 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 ...
3
votes
2answers
182 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
83 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
76 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 ...
1
vote
1answer
49 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
31 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
47 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 ...
2
votes
1answer
63 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
65 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
54 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
33 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
82 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
80 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 ...
2
votes
2answers
276 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
105 views

Speeding up large GeoJSONs in Leaflet maps

I am trying to use Leaflet to make a map which displays multiple projection boundaries, i.e. UTM, State Plane, MGRS. Right now I have three geojson files inside the javascript, but they are quite ...
3
votes
1answer
46 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
99 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
55 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
57 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
57 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
64 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 ...