mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 918 forks source link

Marker Position not updated correctly #2834

Open EinfachHans opened 4 years ago

EinfachHans commented 4 years ago

I'm submitting a ... (check one with "x")

OS: (check one with "x")

cordova information: (run $> cordova plugin list)

com.googlemaps.ios 3.9.0 "Google Maps SDK for iOS"
cordova-clipboard 1.3.0 "Clipboard"
cordova-plugin-advanced-http 3.0.0 "Advanced HTTP plugin"
cordova-plugin-androidx-adapter 1.1.1 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 2.0.0 "cordova-plugin-androidx"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-crop 0.3.1 "CropPlugin"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file-transfer 1.7.2-dev "File Transfer"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-geolocation 4.0.2 "Geolocation"
cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 4.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-ios-disableshaketoedit 1.0.0 "iOS Disable Shake to Edit"
cordova-plugin-ios-keychain 3.0.1 "KeyChain Plugin for Cordova iOS"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-safariviewcontroller 1.6.0 "SafariViewController"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-vibration 3.1.1 "Vibration"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 5.6.8 "SocialSharing"
cordova-sqlite-storage 5.0.1 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova.plugins.diagnostic 6.0.2 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"

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 : 5.28.0
@ionic-native/google-maps : 5.5.0

Current behavior:

I have a pool of marker (count of 50), which gets updated by position and visibility. After i update all of them, some aren't updated in their position. If i add a small Timeout before enabling the visibility it works:

marker.setIcon(markerData.icon);
marker.setPosition(latlng);
setTimeout(() => {
   marker.setVisible(true);
}, 100);

Without it don't. I even can't click them, but if i trigger a click from code, they are placed to the correct position.

Expected behavior:

To not have this bug^^ I'm unsure, but maybe this is because the position update is async and currently we have no possibilty to wait for it's completion?

Screen capture or video record:

If needed i can create a video record, but because of some sensitive data i don't want to share public

Support this plugin activity

I appreicate if you give me a beer :beer: from here

wf9a5m75 commented 4 years ago

Please share your project files on GitHub repository. I guess problem is in your code. This plugin is used by bunch of people, and no one report that. Also this plugin just passes the position data to the Google Maps SDK, no manipulation.

For the reasons, I guess the problem is in your code.

EinfachHans commented 4 years ago

i will create a repo in the next days, thank you!

EinfachHans commented 4 years ago

@wf9a5m75

Here is the Repo with minimal reproducable Code: https://github.com/EinfachHans/google-maps-bug Only appears on ios. btw: while build ios first time, the adding of your plugin takes very long for me (sometimes up to 5 minutes), do you have this too?

info: Looks like not the click on the marker makes it updated, but the setting of a new icon does (what i am doing on marker click)

mcastets commented 4 years ago

btw: while build ios first time, the adding of your plugin takes very long for me (sometimes up to 5 minutes), do you have this too?

Yes. This is related to https://github.com/ionic-team/ionic-native-google-maps/issues/320