mapsplugin / cordova-plugin-googlemaps

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

HTML element on map sometime not working #1889

Closed minhui27 closed 6 years ago

minhui27 commented 6 years ago

I'm submitting a ... (check one with "x") [ ] question [x] any problem or bug report [ ] feature request

If you choose 'problem or bug report', please select OS: (check one with "x") [x] Android [ ] iOS

cordova information: (run $> cordova plugin list)

branch-cordova-sdk 2.6.12 "branch-cordova-sdk"
code-push 2.0.1-beta "CodePushAcquisition"
com.googlemaps.ios 2.5.0 "Google Maps SDK for iOS"
cordova-facebook-audnet-sdk 4.26.2 "Facebook AudienceNetwork SDK for Cordova"
cordova-launch-review 2.0.0 "Launch Review"
cordova-plugin-android-permissions 0.10.0 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-code-push 1.9.5-beta "CodePush"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-crop 0.3.1 "CropPlugin"
cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.3 "Notification"
cordova-plugin-extension 1.5.2 "Cordova Plugin Extension"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-facebookads 4.23.2 "FacebookAds"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin"
cordova-plugin-googlemaps 2.1.1 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.11 "Ionic's WKWebView Engine"
cordova-plugin-is-debug 1.0.0 "IsDebug"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-multidex 0.1.2 "Cordova Multi Dex"
cordova-plugin-nativestorage 2.2.2 "NativeStorage"
cordova-plugin-privacyscreen 0.3.1 "PrivacyScreenPlugin"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4-dev "Cordova WKWebView Engine"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova-plugin-x-toast 2.6.0 "Toast"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-save-image-gallery 0.0.26 "saveImageGallery"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
molpay-mobile-xdk-cordova 3.14.3 "MOLPay XDK for Cordova"
onesignal-cordova-plugin 2.2.0 "OneSignal Push Notifications"

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.3.3",
"@ionic-native/google-maps": "^4.3.3"

Current behavior: The HTML element (button) on the map sometime is not working. When I click on the button, the button is not trigger anything (no response), however it seem like click on the map where the MAP_CLICK event was triggered. The problem also happen on other type of HTML element.

Expected behavior: All the HTML element on the map should work at all time.

Thank you.

wf9a5m75 commented 6 years ago

Please try to reinstall the plugin from the multiple_maps branch.

$> cordova plugin rm cordova-plugin-googlemaps

$> cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID=".."  --variable API_KEY_FOR_IOS=".."
minhui27 commented 6 years ago

Ok. I try it first.

minhui27 commented 6 years ago

The problem still exists when using the multiple_maps branch.

wf9a5m75 commented 6 years ago

Ok, please share your project files on github(or bitbucket). I will check it tomorrow.

minhui27 commented 6 years ago

The link of the project files (sample) is https://github.com/minhui27/map-v2-testing.

wf9a5m75 commented 6 years ago

Thank you for sharing the repo.

When you change the visibility of <div [style.display]="showRestCard ? 'block' : 'none'" id="card-on-map">, you need to notify about that to the plugin.

cordova.fireDocumentEvent('plugin_touch', {});

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/whats-new-v2/README.md#change-4-save-battery-life

wf9a5m75 commented 6 years ago

I think that's why.

minhui27 commented 6 years ago

The problem was solved after I add in the code. Hopefully the problem will not exist anymore. Thank you.

tuanvuf4 commented 6 years ago

@minhui27 can you show me how did you add in your code?

minhui27 commented 6 years ago

@tuanvuf4 you can refer to this repo https://github.com/minhui27/map-v2-testing. The code is add in as shown in the last commit, https://github.com/minhui27/map-v2-testing/commit/f7c051d918aae38256f18adbae8d71487bf0893e.

tuanvuf4 commented 6 years ago

ok. Thanks

minhui27 commented 6 years ago

welcome