Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
756 views

Leaflet GeoJSON map legend

I am struggling with creation of the map legend adequate to my GeoJSON stylization. The code looks like below: var geojsonMarkerOptions = { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, ...
0
votes
1answer
748 views

Creating 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","...
4
votes
2answers
27 views

Adding different types of marker on the map with using Leaflet.draw

I am using Leafletjs with Leaflet.draw to create an interactive map on my web. But I need to enable different types of "marker". And then when creating them I need to identify them. I tried ...
0
votes
1answer
44 views

What routing system support off-road routing for Leaflet integration?

I have a collection of regionally specific linestrings and multi-line strings which are off-road paths. I would like to be able to integrate these into a Leaflet routing systems which would ...
2
votes
1answer
37 views

Rotation of a cropped portion of a raster map

We create printed maps from a GeoTIFF file projected in LCC, which is a common projection for aviation maps. Part of our process includes customization of the raster image by selecting a region and ...
1
vote
1answer
258 views

Leaflet layer spy

OpenLayers3 has a really neat layer-spy example. The source code for the example indicates it uses the precompose and postcompose event listeners for an ol.layer.Tile: var imagery = new ol.layer.Tile({...
0
votes
1answer
20 views

Adding dynamic image-URL in img src? [closed]

I'd like to show a dynamic image (csv import) in my leaflet map, like: .bindPopup("my dynamic imgage: " + <img src={row.myPicture}/>); but can't figure out how to combine the img src ...
9
votes
5answers
17k views

Using SVG icon as marker for a geoJSON point file in Leaflet?

I have a basemap that displays locations from a geoJSON file. Instead of the default markers I would like to use my own svg files, but can't find out how.
0
votes
1answer
38 views

Leaflet geolocation alternative for if access is denied [closed]

I have the following that prompts the user to give location access. On granting permission the user's location is shown and the map loads. I'm trying to find a solution for if the user accidentally ...
11
votes
5answers
30k views

Sizing Leaflet Map inside bootstrap

I have been trying to change the height of my leaflet map to a percentage inside of bootstrap but everytime I do the map will not draw. Thus, I always have to revert to px value. I'm pretty sure its a ...
20
votes
2answers
39k views

Add/Remove legend with Leaflet layers control?

I have two overlays http://02d0c8c.netsolhost.com/dev/lcb_census_layers3.html that can be turned on and off with a Layer Control. I’d like the legend for each layer to turn on/off along with the ...
2
votes
1answer
17 views

Using my “layerGroup” outside of the function

The console show this error: "spots is not defined" How can I use my layerGroup spots outside of the function? $.get("./data.csv", function (csvString) { var data = Papa.parse(...
1
vote
2answers
1k views

Dynamic map sidebar with info from marker upon click

I am new to Leaflet, HTML, CSS and Java. I am using leaflets maps and I want to create a sidebar that is active when a marker is clicked or active when a clicked in the sidebar, so far I have had no ...
1
vote
1answer
183 views

Dividing GeoJSON into two separate layers in Leaflet

Basing on this example: http://www.gistechsolutions.com/leaflet/DEMO/sports/sports.html I would like to do the same in my case, however, my way is slightly different: Firstly I have made a major ...
-1
votes
1answer
25 views

Choose the export name of a file from Leaflet [closed]

Is it possible to choose a name for the file exported to GeoJSON from Leaflet? In this discussion : Adding GeoJSON properties when creating marker in Leaflet , there is the possibility to export to a ...
0
votes
1answer
37 views

Leaflet - remove data from layer?

I have a quite complex webapp with a lot of data on a map. Except the basemap, the data of each layers are coming from AJAX queries, witch's responses are formatted as GeoJSON object -- up to this ...
0
votes
1answer
41 views

Issues with GeoServer GetFeatureInfo request parameters

I managed to make GetFeatureInfo request but it has some issues still. This is code: function request(e) { var BBOX = that.mymap.getBounds().toBBoxString(); var WIDTH = 101; var HEIGHT = 101; /...
1
vote
1answer
87 views

Cannot add Leaflet markers to map iterating through CSV

I have data from a CSV that I want to turn into markers using the latest version of LeafletJS. I can successfully turn the CSV into an array of js objects and have confirmed that the latlng ...
0
votes
0answers
19 views

Extend Leaflet JS Polygon by x kilometers

I have a huge JSON file with a lot of polygons and I want to extend each polygon by, let's say, 4 kilometers. I don't know any plugin that can do this. Is there a way to achieve this?
0
votes
0answers
26 views

Creating the Leaflet map offline(load the leaflet tiles without internet)

I have created the Leaflet map which works in online. But now my requirement is to create the Leaflet open street map in offline. How do I load the Leaflet map offline?
2
votes
1answer
27 views

TypeError when entering info in leaflet-geosearch search bar

I am using leaflet-geosearch. When I begin typing anything into the search bar, nothing pops up, and the developer console reads: SearchControl.ts:28 Uncaught (in promise) TypeError: Cannot read ...
1
vote
1answer
767 views

Showing all features by real-time API with Leaflet Map

I want to show all URL parameters or features onto a map. I have made the variable with ajax query as well as inside the loop data is printing with variable but I want to show this data with map into ...
1
vote
1answer
20 views

Leaflet Locate current location

I'm new to Leaflet and anything web related. I have got the following map working which asks for your location and changes the map view to that location. That is great but then the map continues to ...
0
votes
1answer
305 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
3k views

How to make the value showing on a Leaflet heatmap like this one?

I'm attempting to use leaftlet.js, and heatmap.js (github.com/pa7/heatmap.js/) following this example: But I want to show the value on the heat map like this crime page (with two options on: "Crime ...
0
votes
0answers
24 views

Adding new boundaries inside the clicked polygon/Area using Leaflet and TopoJSON [closed]

I have decided to use topojson+leaflet in my maps but I have this problem I want to add smaller polygons inside a clicked/Zoomed polygon. I have managed to add a big polygon but now to add new ...
2
votes
1answer
48 views

What parameter to pass to Proj4Leaflet

I need to use https://github.com/kartena/Proj4Leaflet for my case. I have EPSG:32638 But I don't know what parameter to pass to constructor. From the web site it has example: var crs = new L.Proj.CRS('...
1
vote
1answer
29 views

Temporarily hiding features that are not selected at the moment in Leaflet

How can I set focus on the selected feature by additionally and temporarily hiding other features that are not selected at the moment. Here is my code: var highlight = { 'color': '#149c14', ...
0
votes
1answer
53 views

Passing GeoJSON API to Leaflet (proj4leaflet) map

I have created a geographical view of a point using Leaflet based on a coordinate system data. Since I'm using the coordinate system rather than lat and long, I'm using proj4leaflet for the conversion ...
-1
votes
0answers
22 views

How to call a API in proj4leaflet [duplicate]

I have created a geographical view of a point using Leaflet based on a coordinate system data. Since I'm using the coordinate system rather than lat and long, I'm using proj4leaflet for the conversion ...
-1
votes
0answers
26 views

How to call a GeoJSON API in Proj4Leaflet and show the output in a map view [closed]

I’m having some data with RD coordinates in my database. I have developed an API that can render the data in GeoJSON format. But I’m not sure how to call an API in Proj4Leaflet. How can I do this?
1
vote
2answers
266 views

Zoom to points using d3SvgOverlay

I have an application where a csv file is filtered and the filtered data is displayed on a Leaflet map. What I would like to happen is for the map to zoom in to the points. I have tried using ...
0
votes
0answers
33 views

Adding multiple Leaflet maps on the page [closed]

I want to place the multiple Leaflet maps on the page based on the server-side. .component.ts for (var i = 0; i < this.map_var.length; i++) { map[i] = L.map(this.map_var[i]).setView([12.9249, ...
0
votes
0answers
58 views

GeoServer GetFeatureInfo parameters

I have a Leaflet map where on click I send GetFeatureInfo request to GeoServer, but the content of the HTML it returns is empty. I suppose I am computing parameters that I pass incorrectly, this is my ...
0
votes
0answers
27 views

onEachFeature bindPopup

I am trying to use Mapbox to display my maps. a) I need to bind a popup on each polygon within a Tileset. I have done it in Leaflet using the onEachFeature function. The data should come from the ...
2
votes
1answer
78 views

Picking up the coordinates inside this polygon draw

I already have a geojson being consulted and that is plotting these black dots. And then I inserted the leaflet-geoman plugin to give users the freedom to create polygons on the map. Basically draw ...
2
votes
1answer
38 views

Putting different id in different paths on my Leaflet map

I have many polygons to display on map like this: L.geoJSON(polygon, { style: function (feature) { return { stroke: true, fillColor: feature.color, ...
2
votes
2answers
43 views

Adding GeoJSON properties when creating marker in Leaflet

I used a manual marker input development under Leaflet found on this website : http://www.gistechsolutions.com/leaflet/DEMO/basic/addmarker.html I have added two properties to the markers: name and ...
0
votes
3answers
5k views

Getting Leaflet map to work offline?

I am interested in how to create a base map for Leaflet offline with XAMPP. Is this just a picture of what you draw from the Internet and then specifies the path with L.tileLayer? I'm still a bit ...
0
votes
1answer
32 views

Leaflet's map.project(latlng, zoom) without a leaflet map instance

I am working with a leaflet app and I'm shifting a lot of the GIS calculations to the back end (a nodejs app). I need to be able to get the RGB value of a pixel given the latlng and the map zoom. (I'...
1
vote
1answer
34 views

Getting Leaflet routing control result outside map in a div or table [closed]

All of the examples of Leaflet routing control display the result (iterenary) inside the map area. I want to display it outside in a div or table element. There is ItineraryBuilder in the API but no ...
0
votes
1answer
45 views

Convert a ee.Geometry() into a Leaflet polygon

I'm using the Leaflet and gee API in a Python notebook. In this notebook I'd like to display a featureCollection as a layer on a Leaflet map. #retreive the asset asset_descripsion = 'Glad_' + ...
5
votes
1answer
108 views

Spatio-Temporal Plot on a Basemap

I have trajectory data in LineStringM format and visualize relevant results via Leaflet on street map tiles. I was wondering whether it is possible to visualize spatiotemporal plots on OSM tiles. I ...
0
votes
1answer
23 views

Access individual feature properties when running l.esri.find or l.esri.query

Here is what my site looks like: https://brandonlprice.github.io/landrecords/. How can I access the feature properties for a layer when running a find or a query on a layer? I have the the feature....
2
votes
1answer
133 views

How to create a Legend with Points. Same size in Legend and Map. Leaflet

I am trying to create a Legend in Leaflet that contains the circles in the map. But, the size in the legend should the same size that it is in the map. My code is next. function getRadius(pop) { var ...
1
vote
1answer
571 views

Preventing map panning to last drawn marker using Leaflet?

I have a basic Leaflet map where I need to draw several markers and lines on. How do I prevent the map from panning to the last drawn object? I've read about setting autopan : False for popups from ...
1
vote
2answers
40 views

Bounding box doesn't change the extent of the map [closed]

I want to display maps in Leaflet that are only visible on the bounding box. The code works fine without the bounding box but the maps are too many so displaying the maps is very slow. Here is my ...
0
votes
1answer
230 views

Filter getInfo request

Following this example and according to Leaflet WMS documentation I extended L.WMS.Source class and overwrote hooks (e.g. showFeatureInfo). My example can be found here. When I use the code as ...
2
votes
1answer
39 views

How to use Leaflet to display a map in Lambert Conformal Conic without warping to EPSG:3857

I would like to display a map in leaflet which is in Lambert Conformal Conic. The CRS of this map is: '+proj=lcc +lat_0=38 +lon_0=-100 +lat_1=45 +lat_2=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs' ...
2
votes
2answers
63 views

Showing WMS layer data and marker popup simultaneously in Leaflet

I need to show WMS layer information and if there are some marker or other layers at the same coordinate, it should show both data of WMS layer and marker information. But when marker covers wms layer,...

1
2 3 4 5
69