polyline needs to be data, not array

This commit is contained in:
Dennis Luxen
2011-06-28 08:27:38 +00:00
parent e3b648ea72
commit 5b621d8fe9
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -49,15 +49,18 @@ private:
}
public:
inline void printEncodedString(vector<_Coordinate>& polyline, string &output) {
output += "\"";
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);
}
output += "\"";
}
inline void printUnencodedString(vector<_Coordinate> & polyline, string & output) {
output += "[";
string tmp;
for(unsigned i = 0; i < polyline.size(); i++) {
convertLatLon(polyline[i].lat, tmp);
@@ -71,7 +74,7 @@ public:
output += ",";
}
}
output += "]";
}
};