alert a message in case network dies or so on editstops
This commit is contained in:
parent
ba4f482a2b
commit
feadf4b110
|
@ -123,7 +123,7 @@ class Stop(models.Model):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_geojson(self, srid=4326):
|
def get_geojson(self, srid=4326):
|
||||||
print srid
|
# print srid
|
||||||
if self.point is not None:
|
if self.point is not None:
|
||||||
geom = json.loads(self.point.transform(srid, True).geojson)
|
geom = json.loads(self.point.transform(srid, True).geojson)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -223,12 +223,15 @@ var API_BASE = "/1.0/",
|
||||||
var geojsonString = JSON.stringify(geojson);
|
var geojsonString = JSON.stringify(geojson);
|
||||||
//console.log(geojsonString);
|
//console.log(geojsonString);
|
||||||
var url = API_BASE + "stop/" + stop.slug + "?srid=3857";
|
var url = API_BASE + "stop/" + stop.slug + "?srid=3857";
|
||||||
$.post(url, {'geojson': geojsonString}, function(response) {
|
var $postXHR = $.post(url, {'geojson': geojsonString}, function(response) {
|
||||||
if (response.errors) {
|
if (response.errors) {
|
||||||
alert("error saving");
|
alert("error saving");
|
||||||
}
|
}
|
||||||
//console.log(response);
|
//console.log(response);
|
||||||
}, "json");
|
}, "json");
|
||||||
|
$postXHR.fail(function(e) {
|
||||||
|
alert('failed ' + JSON.stringify(e));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return $div;
|
return $div;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user