Skip to content

Commit 4ddd5fd

Browse files
Keith BannisterKeith Bannister
authored andcommitted
FIx first location
1 parent f5e78b8 commit 4ddd5fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ekayak.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ function locationSuccess(position) {
3939
locationText.textContent = `lat/long:${c.latitude}/${c.longitude} speed:${c.speed} heading:${c.heading} altitude:${c.altitude} accuracy:${c.accuracy} altaccuracy:${c.altitudeAccuracy} timestamp:${position.timestamp}`;
4040
const latlng = [c.latitude, c.longitude];
4141
if (npositions == 0) {
42-
map.flyTo(latlng, Number(zoomLevel), {animate:true});
42+
console.log("Flying to", zoomLevel, latlng);
43+
//map.flyTo(latlng, Number(zoomLevel), {animate:true}); // Flying takes too long and stops when the next location comes in
44+
map.setView(latlng, zoomLevel);
45+
4346
} else {
47+
console.log("Panning to", latlng);
4448
map.panTo(latlng);
4549
}
4650
breadCrumbLine.addLatLng(latlng);

0 commit comments

Comments
 (0)