وقتی میخوام لوکیشن روبگیرم یک لحظه نمایش میده ودوباره برمیگرده تو نقشه
سلام امیر عزیز
بخاطر اسکریپت زیر هستش که به محض دریافت لوکیشن شما میاد و لوکیشن فعلی رو نشون میده.
میتونید از اسکریپتها خارجش کنید و در صورت نبودن لوکیشن اعمالش کنید:
map.on('locationfound', function(e) {
// if position defined, then remove the existing position marker and accuracy circle from the mapif (current_position) {
map.removeLayer(current_position);
map.removeLayer(current_accuracy);
}
var radius = e.accuracy;
current_position = L.marker(e.latlng).addTo(map)
.bindPopup("دقت تقریبی: " + radius + " متر").openPopup();
current_accuracy = L.circle(e.latlng, radius).addTo(map);
});
// indexif($location): ?>
L.marker([=$location->lat?>, =$location->lng?>]).addTo(map).bindPopup("=$location->title?>").openPopup();
else:?>
map.on('locationfound', function(e) {
// if position defined, then remove the existing position marker and accuracy circle from the map
if (current_position) {
map.removeLayer(current_position);
map.removeLayer(current_accuracy);
}
var radius = e.accuracy;
current_position = L.marker(e.latlng).addTo(map)
.bindPopup("دقت تقریبی: " + radius + " متر").openPopup();
current_accuracy = L.circle(e.latlng, radius).addTo(map);
});
endif; ?>
احمدرضا فاطمی کیا۰۵ مرداد ۱۴۰۲، ۰۷:۰۳
دقیقا متوجه نشدم.ممنونمیشم واضحتر توضیح بدید
امیر احمدی۰۵ مرداد ۱۴۰۲، ۱۵:۱۱
شما بار اول که اجازه لوکیشن رو میدید بعدش خود اسکریپت بررسی میکنه که با پیدا شدن لوکیشن نقشه مکان شما رو پیدا کنه.
احمدرضا فاطمی کیا۰۶ مرداد ۱۴۰۲، ۱۳:۴۹
فکر کنممنظور شما اینهکه این قسمت روکامنتکنم.ولی بازم کار نکرد.اصلا لوکیشن فعلیه منو نمایش نمیده
امیر احمدی۰۶ مرداد ۱۴۰۲، ۱۵:۰۷
پروژه رو به همراه دیتابیس در گیت قرار بدید بررسی بشه.