2020 <button text =" marker" @tap =" addMarker($event)" />
2121 <button text =" updateMarker" @tap =" updateMarker($event)" />
2222 <button text =" camera" @tap =" animateCamera($event)" />
23- <button text =" location" @tap =" trackUser($event)" @longPress =" getUserLocation ($event)" />
23+ <button text =" location" @tap =" trackUser($event)" @longPress =" stopTracking ($event)" />
2424 <button text =" source" @tap =" addSource($event)" />
2525 <button text =" polygon" @tap =" addPolygon($event)" @longPress =" removePolygon($event)" />
2626 <button text =" polyline" @tap =" addPolyline($event)" @longPress =" removePolyline($event)" />
@@ -112,7 +112,7 @@ export default {
112112 return this .map .removeMarkers ([1 , 2 ]);
113113 }
114114 });
115- this .map .setCenter ({ ... this .firstMarker , animated: true });
115+ this .map .setCenter ({ ... this .firstMarker , animated: false });
116116 },
117117 animateCamera(event ) {
118118 this .map .getTilt ().then ((tilt ) => {
@@ -139,11 +139,14 @@ export default {
139139 },
140140 trackUser(event ) {
141141 this .map .trackUser ({
142- cameraMode: ' NONE ' ,
142+ cameraMode: ' TRACKING ' ,
143143 renderMode: ' COMPASS' ,
144144 animated: true
145145 });
146146 },
147+ stopTracking(event ) {
148+ this .map .hideUserLocationMarker ();
149+ },
147150 addSource(event ) {
148151 this .map
149152 .addSource (' test' , {
@@ -182,6 +185,7 @@ export default {
182185 })
183186 .catch ((error ) => console .error (error , error .stack ))
184187 .then (() => {
188+ console .log (' source added' )
185189 this .map
186190 .addLayer ({
187191 id: ' test' ,
@@ -253,7 +257,7 @@ export default {
253257 this .map
254258 .addPolyline ({
255259 id: 1 , // optional, can be used in 'removePolylines'
256- color: ' #336699 ' , // Set the color of the line (default black)
260+ color: ' #336699ff ' , // Set the color of the line (default black)
257261 width: 7 , // Set the width of the line (default 5)
258262 opacity: 0.6 , // Transparency / alpha, ranging 0-1. Default fully opaque (1).
259263 points: [
0 commit comments