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.

getMyLocation don´t work v 2.2.9

See original GitHub issue

I’m submitting a … (check one with “x”)

  • question
  • any problem or bug report
  • feature request

If you choose ‘problem or bug report’, please select OS: (check one with “x”)

  • Android
  • iOS

cordova information: (run $> cordova plugin list)

com.googlemaps.ios 2.6.0 "Google Maps SDK for iOS"
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-fcm 2.1.2 "FCMPlugin"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.2.9 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.2.1 "Cordova sqlite storage plugin"
de.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
insert the output from the command here

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

@ionic-native/core": "^4.6.0"
@ionic-native/google-maps"

Current behavior:

I have update the latest version, and location don´t work.

Expected behavior:

Screen capture or video record:

Related code, data or error log (please format your code or data):

{"line":298,"column":103,"sourceURL":"http://localhost:8080/Users/javi/Library/Developer/CoreSimulator/Devices/AF1E8EF9-D2FA-4138-9B36-4CE5FFD74861/data/Containers/Bundle/Application/DAC023AF-D2B9-4B82-A908-3CA764F62A7A/xxxxxx.app/www/plugins/cordova-plugin-googlemaps/www/Map.js","__zone_symbol__currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"angular","cancelFn":null,"runCount":0}}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wf9a5m75commented, Mar 27, 2018

Okay, I found the problem. Please reinstall the plugin from the multiple_maps branch.

$ cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps --variable API_KEY_FOR_ANDROID="..." --variable API_KEY_FOR_IOS="..."

or use plugin.google.maps.LocationService.getMyLocation() instead.

0reactions
AntDelCascommented, Oct 7, 2019

How i can import and use plugin.google.maps.LocationService.getMyLocation()?

I use LocationService.getMyLocation().then(( myLocation: MyLocation) => { … and it no works good in iOs. The first time, ok, but second and next times has error …

ERROR Error: "Uncaught (in promise): TypeError: _this.myLocation is undefined…

Part of my code:


import {LocationService, GoogleMaps, GoogleMapsEvent, LatLng, MarkerOptions, Marker, MyLocation} from "@ionic-native/google-maps";

...
(export class)
public myLocation: any;

...

ngOnInit() {
        LocationService.getMyLocation().then((myLocation: MyLocation) => {
            console.log(myLocation.latLng);
            this.posicion = myLocation.latLng;
...

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why mMap.addMarker (...) and map.getMyLocation()
It seems the reason of the problem is because getMyLocation() is null and the algorithm is expecting it not to be null.
Read more >
Cordova GoogleMaps plugin for iOS and Android (version 2.2.9)
Fix: getMyLocation() does not work on Genymotion. Fix: map disappears sometime on changing ionic tab. Quick demo. <script ...
Read more >
How to get my location (latitude longitude) using ... - Quora
Step 1 : Make a new java class GPSTracker. Step 2 : Copy the following code in it. [code]public class GPSTracker extends Service...
Read more >
How to fix Google Maps when it's not working How To
You can find the toggle in the Settings menu of the app. While Wi-Fi-only mode is an excellent way to conserve data usage,...
Read more >
5 FANTASTIC Google Maps Features You Want To Know About
Google Maps Tips and TricksGoogle Maps does far more than just give us turn-by-turn directions.With Google Maps you can measure distance, ...
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