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):
|
||||
print srid
|
||||
# print srid
|
||||
if self.point is not None:
|
||||
geom = json.loads(self.point.transform(srid, True).geojson)
|
||||
else:
|
||||
|
|
|
@ -223,12 +223,15 @@ var API_BASE = "/1.0/",
|
|||
var geojsonString = JSON.stringify(geojson);
|
||||
//console.log(geojsonString);
|
||||
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) {
|
||||
alert("error saving");
|
||||
}
|
||||
//console.log(response);
|
||||
}, "json");
|
||||
$postXHR.fail(function(e) {
|
||||
alert('failed ' + JSON.stringify(e));
|
||||
});
|
||||
});
|
||||
return $div;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user