Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
39 views

How can I get the latitude and longitude bounds of a tile set from MapTiler using leaflet.vectorgrid?

I have a leaflet map that loads a vector tile set from Maptiler. I would like the map to fit the bounds of the tile set's content when the user selects the overlay check box to display this tile set. ...
1
vote
0answers
35 views

Adding a popup to features in a leaflet.vectorgrid layer

I am loading a tile set from MapTiler to my leaflet map. I have no trouble styling each feature in the tile set. I can set each feature to the appropriate color. I would like to also add a popup to ...
1
vote
1answer
30 views

Map is not visible at initialization using react-leaflet

I have this react component: import React, { Fragment } from 'react'; import L from 'leaflet'; import { Map, TileLayer, Marker, Popup } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; const ...
0
votes
0answers
49 views

Deploying a GeoDjango project with Apache web server (on Windows system)

I am a newby in deploying web application. I have done a little web-gis app using Django in PyCharm and utilizing Osgeo libraries and drivers with Python37. I have deployed the web server using ...
2
votes
2answers
55 views

Styling polygons in a map tile PBF file in Leaflet

How can I dynamically add data to a pbf file generated by Maptiler? I created a pbf file with the MapTiler desktop application. I started with a geojson file containing polygon geometries. My file is ...
1
vote
0answers
70 views

Using Leaflet.VectorGrid with local GeoJSON and addLayer

I am trying to test out Leaflet.VectorGrid from https://github.com/Leaflet/Leaflet.VectorGrid. My overall goal is to load a large 20MB or larger geojson quickly. I am getting this error... "...
1
vote
0answers
41 views

Render map data faster in Leaflet using MapTiler

I have a Vuejs app containing a Leaflet map that displays GeoJSON files. Some of these files, such as the file containing polygons for all zip codes in a US state are very large and load too slowly. ...
3
votes
1answer
70 views

Specify an alternative URL for a “tileLayer” to use in Leaflet?

Let's say I have a: var myTileLayer = L.tileLayer('https://{s}.tile.SomeMapServer.com/{z}/{x}/{y}.png'); and if some tiles fail to load, I want them to be loaded from 'https://{s}.tile....
0
votes
1answer
43 views

How to get attribute data based on the GeoJSON you clicked Leaflet?

I'm trying to pull the attribute data from a GeoJSON layer. var neighLyr = new L.GeoJSON.AJAX("data/neighbourhood.geojson",{ }).addTo(mymap); neighLyr.on('click', function (e) { console.log(...
3
votes
0answers
45 views

What is tilde (~) for in R? [closed]

I know this is an almost too simple question. But maybe there is a fast answer. Looking through some code to build a leaflet map in R I found that part of code: mypal = colorNumeric( palette = "...
1
vote
1answer
46 views

Understanding theMap.on('click') event of Leaflet [closed]

I inherited code from another person and some of the lines are as follows: theMap.on('click', function(e) { minx = (e.latlng.lng - 0.0000001).toFixed(7); miny = (e.latlng.lat - ...
0
votes
0answers
31 views

Make a draw object option in Leaflet and that stores it in the webmap in a database or on a server

I would like to set up a simple web map which should be used as an information for those out in the field that needs to show something immediately. So I would just load the web map and get an overview....
0
votes
2answers
48 views

Leaflet Feature bindpopup does not display (OnEachFeature)

I am attempting to have a click event popup with some data pulled from Wikipedia and displayed on my Leaflet map for each point that displays GeoJSON data. My data is displayed on map as you can see ...
1
vote
1answer
28 views

How can I find LayerGroup for a given object in Leaflet?

So, I have a LayerGroup with polylines, points, etc. in some Layers. A certain Polyline has the handler: Polyline.on('click', lineHelper); Can I find out in this handler which LayerGroup the ...
0
votes
0answers
58 views

Disable scroll wheel zoom event in Leaflet for R

Is there a way to disable scroll wheel zoom events for Leaflet in R, when you do not know what the zoom is in advance? output$map <- renderLeaflet({ location <- input$location_id lf_bbox &...
1
vote
1answer
28 views

mapfish.print.InvalidValueException: url has an invalid value

I have the config yaml set us below: - !image maxwidth: 120 maxheight: 40 align: left url: "file:\\C:\Program Files (...
0
votes
0answers
45 views

Displaying projection with IMSHOW()

I am having an issue displaying satellite data on the correctly projection using cartopy and imshow. I am unsure of the initial data projection, but I am trying to put it into Plate Carree with a ...
1
vote
1answer
40 views

Adding hyperlink in a popup which comes from a polygon?

I need to add a hyperlink in a popup which comes from a polygon. The following piece of script shows the text which needs to be a link. var polygon = L.polygon([ [51.569, -4.144], [51.568, -4.145], [...
0
votes
0answers
28 views

GeoServer To Vue2-leaflet projection issue

I am using GeoServer (using Tomcat in localhost) and to send a WMS file to my Vue2-leaflet application. My projection in GeoServer is ESPG 4326 This is my Leaflet code : <template> <...
0
votes
0answers
13 views

Assigning “parent” color palettes in Leaflet (using R)

I'm working on creating a map using Leaflet. You'll notice in the first step, I break out each county into four different "regions". I then join it on another geo file of smaller territories within ...
0
votes
0answers
67 views

Display WMS Layer With Geoserver and Leaflet

I am trying to display a WMS layer from geoserver to my Vue.Js application. I am using Vuelayers (Leaflet) for the map rendering. This is my code: <template> <div> <div ...
0
votes
0answers
32 views

Trying to get right combination of Leaflet libraries

I've inherited a project which was using an ancient version of Leaflet and some associated libraries, and have now managed to add the Google Mutant to it. It used to use: <link rel="stylesheet" ...
2
votes
1answer
80 views

Preventing clipped labels from QGIS Server WMS in Leaflet JS

I'm trying to show in Leaflet a WMS map served with QGIS Server. As you can see in this fiddle below there's a problem with the items in the map; they appear to be clipped somehow. The data which are ...
2
votes
1answer
193 views

How do I increase the font size of contents in Map in Leaflet.js?

I am using Leaflet JS for displaying my map. Following is my code. The map gets displayed. But the size of the city names are not large. Each time I zoom in, the font size is very less. It is not ...
1
vote
1answer
49 views

Multiple active TileLayers rather than just one?

I was wondering if it's possible to use multiple TileLayers in leaflet at the same time, rather than just having one active? A bit like group layers. In my map I have a base map, and I would like to ...
0
votes
0answers
31 views

Is there any elevation profile plugin working in MVC5?

I have MVC5 project where I use Mapbox maps to display hiking trails (based on geojson file). Lately, I decided to add elevation profile of these trails to the bottom of the map. However, thats easier ...
1
vote
1answer
39 views

Datefilter in leaflet.js

How do I filter data by date. If I want to filter, I can see the old filtering too. The layers are stacked on top of each other. How do I get the current date range. <div id="time-ranges" class="...
0
votes
1answer
35 views

Popup with Leaflet.markercluster in leaflet map

I am a beginner with leaflet and I tested this code to create a cluster maker. However when I click on the markers the information in the pop-up window is always the same. Could you please tell me ...
1
vote
2answers
78 views

Get waterbody info from base map in Leaflet

I am plotting points on a map using Leaflet, and would like to collect any data I can concerning the water bodies that encompass these points. I have been making use of polygons from HydroSHEDS (...
0
votes
1answer
107 views

Integrate Leaflet / OpenStreetMap autocomplete functionality to an existing search form on a WordPress template

I am trying to add the autocomplete functionality similar to what you have here https://community.algolia.com/places/examples.html#advanced to the search form in my website. Unfortunately there are no ...
1
vote
1answer
40 views

Hosting webmap on Google CLoud Storage without compromising data

Does anyone know how to host a webmap (made with QGIS and Leaflet) on Google Cloud Storage publicaly, so that the HTML showing the webmap is accessible but the data driving the map is not. Bucket ...
0
votes
0answers
42 views

How to download point locations as GeoJSON using Leaflet JavaScript in Django

I want to download point locations from Leaflet js map with Django backend as data collection. When I click on the map it makes a marker and redirects to page http://127.0.0.1:8000/static/data/...
3
votes
1answer
55 views

Shiny leaflet click-event returns NULL when clicked again

When leafletProxy() is used, the click event of leaflet returns NULL when a polygone is clicked for the second time. How can I prevent it from doing so? Example code: library(shiny) library(...
1
vote
0answers
57 views

Contours generated in Leaflet losing coordinates?

I am attempting to use a JavaScript library to generate contours in a leaflet map from a point layer on the map. I have tried this approach with d3 and turf and am getting the same issue where the ...
2
votes
1answer
87 views

Cannot get local GeoJSON file to load features on server hosted Leaflet map [duplicate]

The answers I have tried prior to asking this question: Loading external GeoJSON file into Leaflet map? Load external geojson file into leaflet map Issue in loading external geojson file into ...
1
vote
1answer
50 views

Layer.bindTooltip doesn't work in Leaflet

My objective is to plot polygons and assign a tooltip label to each one. For some reason, my code doesn't seems to work. poly_geojson = L.geoJson(poly_gon,{ onEachFeature(feature, layer) { ...
1
vote
0answers
33 views

No applicable method for 'metaData' applied to an object of class “NULL” with Leaflet map

I'm putting together a Shiny app that involves a Leaflet map. Unfortunately, whenever I run it, it produces this error: "no applicable method for 'metaData' applied to an object of class "NULL"". I'm ...
1
vote
0answers
16 views

Making Leaflet tileLayer grid starts at specified lat lon

My app needs to show a map within a box defined by const corner1 = L.latLng(5.21244812011719, -96.5979537963867); const corner2 = L.latLng(34.086555480957, -55.4220504760742); const map ...
2
votes
0answers
27 views

Leaflet: route machine current position

I would like to insert the current position of the device at the first waypoint. With a function onLocationFound I get the position but I can't add it to the waypoint. Does not work. is there a best ...
1
vote
0answers
33 views

How to manage JSON data in a Leaflet to control layer [closed]

I want to add this json data connection to the map control. This is my JSON data: [ { "id": "1234", "id_jenis": "15", "nama": "", "cabang": "01", "no_sp": "", "pelapor": "...
1
vote
0answers
53 views

Setting up leaflet map in R using if/else if/else filtering

I'm trying to put together a map for work. Right now, the script looks as such (The shape file data can be downloaded here): library(tigris) library(mapview) library(leaflet) library(sf) library(...
1
vote
2answers
134 views

GeoJSON does not appear on my Leaflet map

I'm a beginner in Leaflet and I need help to deal with GeoJSON files. I succeeded in creating a Leaflet basemap. I can add markers without troubles but I cannot manage to show a GeoJSON layer. Here ...
1
vote
1answer
27 views

How can I prevent a marker being dropped when the map is dragged in Leaflet?

I am using Leaflet to display a map in Angular8. I want to add a marker to the clicked location. Everything works fine, except the fact that a marker is being added after I finish dragging the map, ...
0
votes
0answers
16 views

Async code in Leaflet TileLayer extension?

Basic problem: This defect on leaflet.TileLayer.WMTS: https://github.com/alexandre-melard/leaflet.TileLayer.WMTS/issues/17 How to properly fix it (i.e. no hack that the user has to manually specify ...
1
vote
2answers
36 views

getMapData returns NULL in R

I'm trying to use the getMapData function inside an R shiny app, but the function returns NULL whenever I call it. library(leaflet) # works m <- leaflet() %>% addTiles() %>% setView(-80,30,...
1
vote
1answer
66 views

Leaflet: Compare two side-by-side GeoJSON layers?

I'm trying to use the side-by-side plugin downloaded from https://github.com/digidem/leaflet-side-by-side. I want to create side-by-side GeoJSON layers to compare the cancer rates between the two ...
1
vote
1answer
29 views

Have Feature Click Events for Two Layers On, but only one is active at a time in CARTO.js 4

I am currently developing an application using CARTO.js 4, see here. We have a slider where layers for different years of data are loaded on both sides so you can compare them. We have a feature event ...
1
vote
1answer
41 views

Are searchable maps limited to geocoding APIs like Google

My client wants a searchable map. I'd like to use Leaflet and Mapbox for the map, but is having an address-search feature limited to geocoding APIs like Google Maps or Mapquest?
1
vote
0answers
76 views

Leaflet circleMarker's not working - but marker works fine

Using Leaflet, I'm adding around 15,000 circleMarker's to a geoJson layer. The circleMarker's, however, are not showing on my map when the layer is added, despite specifying the relevant styling ...
1
vote
1answer
43 views

Get label pop up on active layer only

I have this layer from Geoserver which I overlay in PNG Format on my leaflet map: ///// Geoserver Layers in WMS format var pop_tot = L.tileLayer.wms("http://localhost:8081/geoserver/cite/wms", { ...

1 2 3 4 5 63