1
0
Fork 0

Phi: avoid error on RouteManager Layer for empty routes

This commit is contained in:
Torsten Dreyer 2015-03-26 09:32:36 +01:00
parent 1a327a9549
commit 4801887b5e

View file

@ -67,7 +67,9 @@
var url = "/json/autopilot/route-manager/route?d=3";
var jqxhr = $.get(url).done(function(data) {
self.clearLayers();
self.addData(self.routePropsToGeoJson(data));
var geoJSON = self.routePropsToGeoJson(data);
if( geoJSON )
self.addData(geoJSON);
}).fail(function(a, b) {
self.updateId++;
console.log(a, b);
@ -115,10 +117,8 @@
"coordinates" : lineString,
});
if( lineString.length < 2 )
return {}
return geoJSON;
if( lineString.length >= 2 )
return geoJSON;
},
});