All Questions
24
questions
1
vote
1
answer
69
views
How to prevent click on outside of polygons in Leaflet map js?
We have multiple arrays of lat long, ( here 3 arrays are stored in success_content_mapareas )
Accordingly, we have created the map and it looks like this, which seems okay in the image below.
We need ...
0
votes
1
answer
3k
views
Find user's current location with Leaflet
In my project I am using leaflet to display points. I want to get the current lat and long after clicked on button Show Your Location, I tried the below code:
https://jsfiddle.net/a1p26e7v/
What do i ...
4
votes
1
answer
3k
views
Leaflet map marker dragging is not working properly on mobiles when disabling scrolling
I added an OpenStreetMap map on my project using Leaflet. I wanted to disable scrolling on mobiles and wheel scroll on desktops. I used the following options found here and managed to achieve this.
...
2
votes
0
answers
405
views
Load large GeoJson files on demand on a leaflet map (checkboxes)
I have heavy Geojson files to display on a leaflet map. Because they are heavy, I would like them to be loaded only if the user checks a specific box on the map related to each of these Geojson files.
...
0
votes
0
answers
271
views
TypeError: this.source is not a function, this.source is null
I'm trying to redo this tutorial, when I search autocomplete I have error TypeError: this.source is not a function. (In 'this.source( { term: value }, this._response() )', 'this.source' is null)
$....
1
vote
2
answers
2k
views
Generate 10,000 markers with good performance with layer group leaflet
Hello I need help I have an application that I need to generate 10k of markers and I can't use the cluster after the client wants all the points on the map, I even used a library: https://github.com/...
0
votes
0
answers
380
views
Creating Map With Leaflet and OpenStreetMap
I want use leaflet map and try as following code, but it don't work true and the map is still not displayed.
How can run it?
var map = L.map('map');
L.tileLayer('https://api.mapbox.com/styles/v1/{...
0
votes
0
answers
346
views
document.getElementById().value not returning textbox value
I am trying to build a delivery optimization app with openstreetmaps, leaflet, javascript with a flask back-end.
The idea is that a delivery manager can click on a map to create a texbox(es) that ...
2
votes
1
answer
66
views
Sending a variable from a function in JS
I have a JS script with a map, which works well:
var lat = 0;
var lng = 0;
function onLocationFound(e) {
var radius = e.accuracy / 2;
lat = e.latlng.lat;
lng = e.latlng.lng;
console.log(e....
2
votes
1
answer
634
views
Centering the map in the place where the user is located in OpenStreetMap
I am beginner webmaster.
I have map with 2 markers and round.
I have this code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>...
1
vote
3
answers
3k
views
Leaflet map not showing properly on mobile
I have a page with filters on top and a toggle between tile view or map view.
Every time a filter is changed I perform a search with AJAX and change the view using Mustache.
On mobile the default ...
0
votes
1
answer
878
views
get json data from a ajax request
I am pretty new to JSON and ajax and don't know, how to get the JSON data from my request?
At the moment I have got two forms. One is for the search(a address) and the other one is for validating the ...
0
votes
2
answers
149
views
Access the value of an input that is loaded after the dom
how can I access the value of an input text field, which loads propably after the dom?
I am working with leaflet at the moment and a plugin creats an input field and I don't know, how to access it.
...
1
vote
1
answer
994
views
How can I reverse geocode to get country name of a given state/regione or city name?
I am trying to find the country name of a given location, for example lets say I know pennsylvania how do I find out automatically United States of America?
I found a couple of links for reverse ...
0
votes
2
answers
8k
views
Leaflet : Function to initialize map container
Have the latitude and longitude of various places in a html table, on clicking the row,a function sends the latitude and longitude values to a javascript function which loads the openstreetmap map and ...