FIX
This commit is contained in:
parent
7ac9048aa8
commit
5758359c5b
|
|
@ -27,7 +27,15 @@ function showMeOnTheMap() {
|
||||||
|
|
||||||
function geolocationSuccess(pos) {
|
function geolocationSuccess(pos) {
|
||||||
$('#showMeOnTheMap').removeClass('inProgress');
|
$('#showMeOnTheMap').removeClass('inProgress');
|
||||||
|
|
||||||
|
if (typeof(points.circle) != "undefined") {
|
||||||
|
myMap.removeLayer(points.circle);
|
||||||
|
}
|
||||||
coords = [pos.coords.latitude, pos.coords.longitude];
|
coords = [pos.coords.latitude, pos.coords.longitude];
|
||||||
|
|
||||||
|
points.circle = L.circle(coords, pos.coords.accuracy);
|
||||||
|
points.circle.addTo(myMap);
|
||||||
|
|
||||||
$.cookie('userLat',pos.coords.latitude);
|
$.cookie('userLat',pos.coords.latitude);
|
||||||
$.cookie('userLng',pos.coords.longitude);
|
$.cookie('userLng',pos.coords.longitude);
|
||||||
myMap.removeLayer(points.im);
|
myMap.removeLayer(points.im);
|
||||||
|
|
@ -37,6 +45,11 @@ function geolocationSuccess(pos) {
|
||||||
|
|
||||||
function geolocationFailure(positionError) {
|
function geolocationFailure(positionError) {
|
||||||
$('#showMeOnTheMap').removeClass('inProgress');
|
$('#showMeOnTheMap').removeClass('inProgress');
|
||||||
|
|
||||||
|
if (typeof(points.circle) != "undefined") {
|
||||||
|
myMap.removeLayer(points.circle);
|
||||||
|
}
|
||||||
|
|
||||||
if(positionError.code == 1) {
|
if(positionError.code == 1) {
|
||||||
text = "Вы решили не предоставлять данные о своем местоположении, " +
|
text = "Вы решили не предоставлять данные о своем местоположении, " +
|
||||||
"но это не проблема. Мы больше не будем запрашивать их у вас.";
|
"но это не проблема. Мы больше не будем запрашивать их у вас.";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue