missing check for empty polylines
This commit is contained in:
parent
5b621d8fe9
commit
4639187180
@ -50,8 +50,10 @@ private:
|
||||
public:
|
||||
inline void printEncodedString(vector<_Coordinate>& polyline, string &output) {
|
||||
output += "\"";
|
||||
if(polyline.size() > 0) {
|
||||
output += encodeSignedNumber(polyline[0].lat);
|
||||
output += encodeSignedNumber(polyline[0].lon);
|
||||
}
|
||||
for(unsigned i = 1; i < polyline.size(); i++) {
|
||||
output += encodeSignedNumber(polyline[i].lat - polyline[i-1].lat);
|
||||
output += encodeSignedNumber(polyline[i].lon - polyline[i-1].lon);
|
||||
|
Loading…
Reference in New Issue
Block a user