mirror of
https://github.com/mapbox/polyline.git
synced 2026-02-01 15:24:40 +00:00
jshint
This commit is contained in:
parent
3bf94673da
commit
9af6cd3df9
@ -9,14 +9,19 @@
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"jshint": "2.3.0",
|
||||
"mocha": "1.2.x"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"scripts": {
|
||||
"test": "mocha -R spec"
|
||||
"test": "jshint src && mocha -R spec"
|
||||
},
|
||||
"main": "src/polyline.js",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"jshintConfig": {
|
||||
"undef": true,
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,9 +22,10 @@ polyline.encodeCoordinate = function(coordinate) {
|
||||
|
||||
// See http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/decode.js
|
||||
polyline.decodeCoordinate = function(str) {
|
||||
var result = 0, shift = 0;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var binary = str.charCodeAt(i) - 63;
|
||||
result |= (b & 0x1f) << shift;
|
||||
result |= (binary & 0x1f) << shift;
|
||||
shift += 5;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user