-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
I have the following code snippets:
In NativeScript-Vue.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<Mapbox
accessToken="TOKEN"
mapStyle="streets"
latitude="-5.852365494"
longitude="-35.36503315"
hideCompass="false"
zoomLevel="12"
showUserLocation="true" <!-- Not Working -->
disableZoom="false"
disableRotation="false"
disableScroll="false"
disableTilt="false"
@mapReady="onMapReady($event)">
</Mapbox>
onMapReady(args) {
args.map.addMarkers([
{
lat: -5.852365494,
lng: -35.36503315,
title: "U S F JOSE COELHO",
subtitle: "Rua José Coelho - CENTRO",
onCalloutTap: () => {
utils.openUrl("https://www.thepolyglotdeveloper.com");
}
}
]);
args.map.getUserLocation().then(
function(userLocation) {
alert(userLocation.location.lat + ", " + userLocation.location.lng)
console.log("Current user location: " + userLocation.location.lat + ", " + userLocation.location.lng);
console.log("Current user speed: " + userLocation.speed);
alert()
}
).catch(e => {
alert("Error: " + e) //Error: Location not available
})
}
Metadata
Metadata
Assignees
Labels
No labels