fixed problem with using non L.LatLng objects

This commit is contained in:
DennisSchiefer 2012-08-13 16:12:41 +01:00
parent 5901b25e69
commit ea84f774a7
2 changed files with 2 additions and 7 deletions

View File

@ -42,12 +42,6 @@ OSRM.init = function() {
// // only init default position / geolocation position if GET parameters do not specify a different one // // only init default position / geolocation position if GET parameters do not specify a different one
// if( OSRM.G.initial_position_override == false ) // if( OSRM.G.initial_position_override == false )
// OSRM.Map.initPosition(); // OSRM.Map.initPosition();
//var polyline = L.polyline([ [51.509, -0.08], [51.503, -0.06], [51.51, -0.047] ], {dashArray:"8,6"}).addTo( OSRM.G.map );
var route = new OSRM.SimpleRoute("test", {dashArray:"8,5"});
route.setPositions( [ [51.509, -0.08], [51.503, -0.06], [51.51, -0.047] ] );
route.show();
}; };

View File

@ -59,7 +59,8 @@ _decode: function(encoded, precision) {
} while (b >= 0x20); } while (b >= 0x20);
var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1)); var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
lng += dlng; lng += dlng;
array.push( {lat: lat * precision, lng: lng * precision} ); //array.push( {lat: lat * precision, lng: lng * precision} );
array.push( [lat * precision, lng * precision] );
} }
return array; return array;
} }