-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'getLocationServices' of undefined #80
Comments
I get exactly the same problem, with nativescript angular. But the thing very strange is : when I have installed the mapBox plugin, few weeks ago, everything worked good ! The worst is I didn't upgrade or changed version of plugin of my app before the bug appear !!! (I use 2.5.1 version) And since this moment, location was unavailable when showUserLocation="true", and get the same error as above. |
Same error here... |
Anybody help us !! Still not possible to show our location marker (in real time) |
@GrEg00z you can still use |
Hey @EddyVerbruggen, It seems that when I wrote the example in question everything worked fine, but in recent updates, whether that be to NativeScript or the Mapbox plugin, things started to break with the errors listed in this thread. I've tested this in Android and can validate the accuracy. Best, |
One really annoying thing about the Mapbox SDK (especially on Android) they tend to move classes around (package-wise) a lot. That's the case for |
Yep, LocationServices was removed, that's what causes "Cannot read property 'getLocationServices' of undefined". Usually I pin to a specific version but I needed the 5.x SDK in the last update but it was still a snapshot release at the time. They've actually released a stable beta of 5.x so I'll pin to that and see if all works correctly. |
Thanks @EddyVerbruggen ! |
You're welcome @nraboy - I've now updated the locationservices stuff as well. I must say this is a much better implementation than it ever was on Android; the Mapbox SDK needed you to draw your own location marker on Android, whereas on iOS it was all managed internally by Mapbox. Android is on par with iOS now. Please update the plugin from GitHub as this fix is not on npm yet. If one of you guys can confirm all is well after the update then I'll push it to npm. Note that you should remove and readd the Android platform folder to avoid lingering Mapbox SDK files. One issue I found (and will fix tomorrow) is that adding markers seems broken. |
is this mean I must use nativescript angular ? I am using typescript, but there is no registerElement available |
@shyandsy no, there's no need for Angular at all. Just follow these instructions. |
… another method was removed in the Android Mapbox SDK :(
Found why the markers no longer worked: a method was removed from the Mapbox SDK, so I'm now using a different one. |
Hey @EddyVerbruggen, I can confirm the errors went away on Android. There was an application crash without error, but I think my simulator might be botched. I'll open a new ticket if it continues. It only happened once. Please push the fix to NPM. Thanks, |
It's on npm. |
Works great ! Thanks @EddyVerbruggen |
… another method was removed in the Android Mapbox SDK :(
Hi,
i'm trying to add a mapbox to my view (android). My view uses the RadSideDrawer from Telerik UI (actually I'm using nativescriptng2drawerseed) and implements OnInit.
I've used @nraboy's demo app nativescript-photos-near-me to get into everything. Seemed to be pretty easy, however I'm experiencing some issues.
What i did:
app.module.ts
home.page.xml
home.page.ts
AndroidManifest.xml
First issue: my app doesn't start, if I add
in AndroidManifest.xml. Instead, i have to use
After adding the "right" service, the map shows on my view (without location marker) but as soon as the location permissions are granted, I'm getting following TypeError:
Did i miss something?
Thank you in advance!
The text was updated successfully, but these errors were encountered: