Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet]

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

2
votes
1answer
77 views

Leaflet Marker autoPan option

According to the Leaflet docs the marker's autoPan option works like this: Set it to true if you want the map to do panning animation when marker hits the edges. What does 'the marker hits the ...
0
votes
0answers
98 views

Leaflet: Resize label when zoom in

I show label on polygon in onEachFeature function, like this function onEachFeature(feature, layer) { label = L.marker(layer.getBounds().getCenter(),{ icon: L.divIcon({ className: 'label',...
2
votes
0answers
71 views

Leaflet zoom event direction

Is it possible to find out whether the user zooms in or out when using a Leaflet zoomstart or zoom event? map.on('zoomstart ', function() { console.log('I am zooming, but am I zooming in or out?'...
1
vote
1answer
163 views

Updating map when external GeoJSON data is modified?

We have a Leaflet map embedded into an OLE Browser Control in our client application named [T]. The HTML file we have today loads dynamic data from a local GeoJSON file that is generated on request ...
0
votes
0answers
65 views

Leaflet not working correctly on mobile

I have been experimenting with Leaflet today (new to it all) and I have found a way to search for an address and it places a glyph and moves the viewpoint of the map to the glyph where it has found ...
0
votes
1answer
50 views

Leaflet layer tree plugin - overlays unvisible after base layer switch

having the same problem as Leaflet layer tree plugin - order layers, i installed the solution but that does not work for me: added zIndex:10 to the base layers code: "base", ...
5
votes
0answers
109 views

Using WFST in Leaflet: can not move/delete features

I write a Leaflet app which makes use of two plugins Leaflet.Draw and Leaflet.WFST. The first allows to create/edit/delete features, the second saves changes to my PostGIS database hosted by GeoServer....
0
votes
1answer
78 views

Spatial functions with MySQL, XAMPP, and Wordpress

I am trying to figure out how to using the ST_AsGeoJSON function in MySQL, but I keep getting an error that says that this function does not exist. I have found in the MySQL documentation that this ...
0
votes
1answer
195 views

Dynamically assign feature properties on L.marker popup interactions

I have a Leaflet based map on which a user can click to create a marker. Then, if one clicks on the marker a popup is opening, where one can change text in a textarea, activate the camera of the ...
0
votes
0answers
35 views

leaflet display geoJson just a like a line

I am trying to construct a choropleth map with leaflet, when I execute the script, just a line is displayed. What can be wrong? <!DOCTYPE html> <html> <head> <meta ...
0
votes
0answers
364 views

Vector Tiles VS Raster Tiles for leaflet

I have downloaded many vector tiles in the mbtiles format from OpenMapTiles. The reason I did that is because I will be using them on a station that cannot have an internet connection at all. I would ...
0
votes
1answer
230 views

Adding custom icons to L.markerClusterGroup?

I am new to leaflet and javascript and would like to add custom icons to the code below but am not sure where exactly to put the code and what stuff to move around... I am looking at the Leaflet....
2
votes
1answer
82 views

From SWEREF99 to EPSG:3857

I have a huge dataset of coordinates referenced with the SWEREF99 coordinate system. Now I would like to convert all these coordinates (and other data as well) to a coordinate system that can be ...
0
votes
1answer
29 views

Carto.JS - Pop up closes when mouse hovers out of feature

As per the CARTO docs I am using the following code to trigger a info pop up when the user's mouse hovers over a feature: const popup = L.popup({ closeButton: false }); ecosystem.on(carto.layer....
1
vote
1answer
198 views

Is there a way to install leaflet search plugin without using npm?

I am not familiar with Node.js or npm at all, but my IT has told me node.js/npm is not compatible with our IIS, and the only search plugins to add on to leaflet are using npm to install them. I did a ...
0
votes
1answer
176 views

How can I stop 'drag' moving my whole map in Leaflet.

I have a leaflet map, containing a tileLayer, and a layerGroup In the layerGroup, I plot circleMarkers, and then connect them with a polyline. Though the markers are defined as draggable, I get no ...
0
votes
1answer
167 views

How can I create layers depending on a property?

I have a .js file with coordinates for internships: var internships = [{ "features": [ {"type":"Feature","properties":{"category":"entretient","Name":"green"},"geometry":{"type":"Point","...
0
votes
1answer
270 views

How to implement a temperature map using leaflet/openlayers?

I am new on Leaflet/OpenLayers. I have been searching the internet for a way to create a temperature map like the one below, but I didn't succeed...the only thing I made was a classical heatmap, but ...
1
vote
0answers
74 views

more than one reactive events to subset markers in Leaflet in R

I am trying to create a shiny ap in R that displays markers on a map. I have a couple of categories that I would like to subset. Currently, I can subset but the map is only reactive on a single input (...
1
vote
1answer
110 views

Leaflet search and popup at other position

In leaflet I want the popup on another position then the standard. So I created a div in which the popup-information is opens. countryLayer = L.geoJson(countryLayer, { onEachFeature: ...
0
votes
1answer
103 views

Setting “Map View” instead of “Split View” in Leaflet javascript

I am using geojson-dashboard framework template for Leaflet (http://fulcrumapp.github.io/geojson-dashboard/). By default, the initial view of the screen is "splitted" or "divided" (half view is the ...
1
vote
1answer
230 views

leaflet - divicon - How to hide the default square shadow?

For example, I write this: L.marker([lat, long], {icon: L.divIcon({html:"China"})}).addTo(map); I checked the documentation: By default, it has a 'leaflet-div-icon' CSS class and is styled as a ...
0
votes
0answers
220 views

Close popup and infowindow when clicking closeButton on popup using carto.js v4

EDITED: I made a jsfiddle at jsfiddle.net/ccoffin/4rwo3kLu/1 Currently, when the user clicks a marker both the popup and infowindow open. When clicking the closeButton on the popup both windows close. ...
0
votes
1answer
206 views

Choropleth map from voronoi map from a set of coordinates (d3+leaflet)

I have a csv file with a set of coordinates with the following structure: id,name,latitude,longitude (24 values). Those 24 points represent coordinates in a city. I would like to get a voronoi map ...
1
vote
1answer
125 views

Display overlapping polyline segments as multiple lines with offsets?

Selecting which polyline is displayed on top in case of segment overlaps seems to be quite a FAQ, however, I would like to find a way to display overlapping polyline segments side-by-side, i.e. as ...
5
votes
2answers
205 views

What is the new projection for Google Maps called?

Google released a new projection for the desktop version of Google Maps which appears to preserve the spherical nature of the Earth at all zoom levels. The old projection was called “Web Mercator”. ...
2
votes
1answer
437 views

leaflet search control not showing up in geodjango app

I have a very basic geodjango app and I am trying to enable search control on it. I have found this question Adding a search box to a Leaflet.js example and the link brought me to what it seems like ...
0
votes
1answer
83 views

images URL “Geojson-dashboard” framework for Leaflet js

a question for somebody that used before the Geojson-dashboard framework for Leaflet (https://github.com/fulcrumapp/geojson-dashboard): Is it possible to add the images URL or Hyperlink dynamically? ...
0
votes
0answers
25 views

Far East Russia Detachment [duplicate]

I'm using Leaflet JS with a modified GeoJSON file of world contries to display a choropleth, like this: Is there any way to display the far-eastern part of Russia as a contiguous entity? Rather than ...
0
votes
0answers
48 views

leaflet rastercoords how to change the map coordinates

I am trying to use leaflet-rastercoords library to make an interactive map. Now everything is running well but I need to change the starting point of the image so that when I call project or unproject ...
0
votes
0answers
166 views

Visualizing OSMNX node colors (by walking distance) in a Leaflet Web Map

I am attempting to display something like this example in a Leaflet web map. This web map will exist in a Flask-created user interface. So far I can get OSMNX networks to show up by themselves (with ...
2
votes
0answers
88 views

Save Mapbox-Vector-Tiles (PBF) on indexeddb and use them offline

I'm developing a PWA(Progressive web app) where I need to retrieve PBF files from a POSTGIS database, then save them on an offline layer, to work as a offline-first app, right now I'm using a ...
0
votes
1answer
63 views

Leaflet not pulling in unique GeoJSON attributes

I am building an app in Leaflet where a user can click on a GeoJSON feature and it will show the unique value of the feature in the popup. The attributes shown are each in an input box so that the ...
0
votes
1answer
1k views

Leaflet address search/geocoding

First off I am pretty new to coding so apologies for the newby questions. Basically I have been using Leaflet to create an interactive map, I have managed to pull in some data from a PostGIS ...
1
vote
0answers
59 views

obfuscate real coordinates

Due to copyrights I cannot deliver some POIs as plain vector data using GeoJSON in Leaflet or OpenLayers. I'm therefor looking for some kind of sane obfuscation, to make it harder for normal users to ...
0
votes
1answer
104 views

GeoDjango raster field display on Leaflet

In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo. here the code : settings.py postgis ...
0
votes
1answer
368 views

Entering manual coordinates to draw polygon in Leaflet?

I want the user to enter manual coordinates of a polygon and then to click on a button to draw the polygon. My code: <body> <div> Polygon: <input type="text" name="...
0
votes
0answers
63 views

Leaflet Popup Icon arrow not in the right place

So I working on my map website and I want to get the coordinates in a place. When I applied this code: var popup = L.popup(); function onMapClick(e) { popup.setLatLng(e.latlng).setContent(" " + ...
0
votes
0answers
414 views

Dynamically created content in Leaflet popup using jQuery

I am trying to make a dynamically created dropdown list to submit user content from a Leaflet popup (each popup contains a different list based on condition). However, I somehow don't manage to clear ...
0
votes
1answer
74 views

Higher than maxNativeZoom requests tiles

Leafet is requesting tiles while at a higher zoom level than maxNativeZoom from defined mapserver instead of just stretching the maxzoom sized tiles. It is creating a lot of 404s since my maxzoom is ...
1
vote
0answers
45 views

GeoServer - labels not working correctly

Currently having a few issues with GeoServer not displaying our labels correctly. The code in question is here: <Fill> <CssParameter name="fill"> <ogc:Literal>#...
0
votes
2answers
90 views

CARTO.js / ReactJS: Showing and hiding layers on toggle

I have a the following layer: class DataLayer extends Component { static contextTypes = { map: PropTypes.object, // Leaflet map }; componentDidMount() { const { client } = this.props; ...
1
vote
2answers
79 views

Get variable from eachfeature function to php?

I have get the variable from onEachFeature function and set on a HTML tag, like this function onEachFeature(feature, layer) { layer.bindPopup(feature.properties.TenCty); layer.on("click", ...
0
votes
0answers
22 views

Getting static .pngs from mbtiles file or other sources

My nomenclature may be astray because mapping and GIS is not my domain. We need to be able to serve tiles locally in a structure lik the folder example provided here: https://www.maptiler.com/how-to/...
1
vote
1answer
292 views

Toggling Leaflet map on click?

I have created a leaflet map in my web page and I would like to show/hide it when I click on a button. I want that first, when I load the page, the map is not visible. HTML code: <div class="...
0
votes
1answer
83 views

Open source public transit directions

I am planning on hosting a map server to serve out directions to my webapp. I need to be able to give public transit directions, time estimate using said public transit, and also offer search for ...
0
votes
2answers
257 views

leaflet change attribution prefix on baselayer change

In leaflet is there a way to change the attribution prefix when a specific baselayer change happens using the default layer control?
0
votes
0answers
80 views

Open multiple popups in a cluster without them overlapping

When clicking on a cluster at a specific zoom level, the cluster should open multiple popups. I most of this done, so when clicking on the cluster all the popups from that cluster open, but they are ...
2
votes
1answer
698 views

How to use custom icons for Leaflet Layer groups

Ok, I have searched posts and tutorials and could not find the answer to my specific application of this feature Almost all the examples use L.marker to simply place a marker on the map using various ...
2
votes
1answer
118 views

Filtering GeoJSONs data using Selects values

I have a bus network with 2 GeoJSONs : one for stations (points) and the other for lines between them. I have 3 selects :first one to select the bus line and filter the stations on the other two that ...