question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Location not available

See original GitHub issue

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
                })
}

Screenshot_20190820-143149_myapp Screenshot_20190820-143137_myapp

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zhitomir-oreshenski-mmcommented, Dec 19, 2019

Hi,

I’ve found a possible workaround using nativescript-geolocation. Hopefully, I will let you know once I have a good news.

Br, Zhi

0reactions
EdvaldoLimacommented, Feb 11, 2020

@zhitomir-oreshenski-mm Yes, this is a viable solution to solve this problem right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Ways to Fix Location Is Not Available Error in Windows 11 ...
Step 1: Open “Task Manager.” You can do it by pressing Shift, Ctrl, and Enter altogether. Step 2: Go to the tab named...
Read more >
How to fix Location is not available Windows 10 error?
How to fix Location is not available Windows 10 error? · Option 1. Access Safe Mode with Networking · Option 2. Reset user...
Read more >
[Solved] Location Is Not Available Access Is Denied Windows 10
4 Effective Fixes for Location Is Not Available Windows 10 · Fix 1. Enable the User and Administrator Permissions (Authenticated Users) · Fix...
Read more >
Fixes to Location is Not Available in Windows 11/10
Fixes to Location is Not Available in Windows 11/10 · Method 1: Enable Full Control for the File or Folder · Method 2:...
Read more >
How to Fix Error “Location is Not Available” in Windows 10, 8, 7?
Why does computer say "location is not available"? ... “Location is available” can be cause by various reasons, like corrupted file system, bad ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found