File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ let npositions = 0;
28
28
29
29
var map = L . map ( 'map' ) . fitWorld ( ) ;
30
30
L . tileLayer ( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' , {
31
- maxZoom : 19 ,
31
+ maxZoom : 21 ,
32
32
attribution : '© OpenStreetMap'
33
33
} ) . addTo ( map ) ;
34
34
var breadCrumbLine = L . polyline ( [ ] ) . addTo ( map ) ;
@@ -39,15 +39,15 @@ function locationSuccess(position) {
39
39
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 } ` ;
40
40
const latlng = [ c . latitude , c . longitude ] ;
41
41
if ( npositions == 0 ) {
42
- map . flyTo ( latlng , zoomLevel ) ;
42
+ map . flyTo ( latlng , Number ( zoomLevel ) , { animate : true } ) ;
43
43
} else {
44
44
map . panTo ( latlng ) ;
45
45
}
46
46
breadCrumbLine . addLatLng ( latlng ) ;
47
47
locationCircle . setLatLng ( latlng ) ;
48
48
locationCircle . setRadius ( c . accuracy ) ;
49
49
50
- npositions += 1 ;
50
+ npositions = npositions + 1 ;
51
51
}
52
52
53
53
function locationError ( error ) {
You can’t perform that action at this time.
0 commit comments