سلام استاد وقتتون بخیر
در مورد دریافت لوکیشن مشکل داشتم که پیام Geolocation error: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).. رو دریافت میکنم
با فیلترشکن هم زمانی که وصل میشم لوکال هاست اجرا نمیشه و از دی ان اس تحریم شکن هم استفاده کردم باز نشد
ممنون میشم راهنمایی کنید .
document.getElementById('map').style.setProperty('height', +innerHeight + 'px');
const DefaultLocation = [35.6950509, 51.3816031];
var map = new L.Map('map', {
key: 'my api in neshan',
maptype: 'standard-night',
poi: true,
traffic: false,
center: DefaultLocation,
zoom: 14
});
var marker = L.marker(DefaultLocation).addTo(map);
marker.bindPopup('default location').openPopup();
/////
function onLocationFound(e) {
var radius = e.accuracy / 2;
L.marker(e.latlng).addTo(map)
.bindPopup("You are within " + radius + " meters from this point").openPopup();
L.circle(e.latlng, radius).addTo(map);
}
function onLocationError(e) {
alert(e.message);
}
map.on('locationfound', onLocationFound);
map.on('locationerror', onLocationError);
map.locate({
setView: true,
maxZoom: 16
});