Skip to content

Commit 174107c

Browse files
committed
chore: demo update
1 parent fc9af79 commit 174107c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

demo-snippets/vue/Basic.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
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: [

demo-snippets/vue/install.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export function installPlugin() {
1010
export const demos = [{ name: 'Basic', path: 'Basic', component: Basic }];
1111

1212
Trace.addCategories(MapboxTraceCategory);
13+
// Trace.addCategories(Trace.categories.Layout);
1314
Trace.enable();

0 commit comments

Comments
 (0)