mapsplugin / cordova-plugin-googlemaps

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

ios 13 animates map marker off screen #2901

Open CodeWithOz opened 2 years ago

CodeWithOz commented 2 years ago

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

OS: (check one with "x")

cordova information: (run $> cordova plugin list)

branch-cordova-sdk 3.2.0 "branch-cordova-sdk"
com.fedirts.cameraroll 0.7.0 "CameraRoll"
com.googlemaps.ios 3.9.0 "Google Maps SDK for iOS"
cordova-background-geolocation 3.6.2 "BackgroundGeolocation"
cordova-launch-review 4.0.1 "Launch Review"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-advanced-http 3.2.2 "Advanced HTTP plugin"
cordova-plugin-android-notch 1.0.0 "AndroidNotch"
cordova-plugin-android-permissions 1.1.2 "Permissions"
cordova-plugin-background-fetch 6.0.8 "CDVBackgroundFetch"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-camera 6.0.0 "Camera"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-file-transfer 2.0.0-dev "File Transfer"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 8.5. "Google SignIn"
cordova-plugin-inappbrowser 5.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-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-local-notification 0.9.0-beta.4 "LocalNotification"
cordova-plugin-media-capture 3.0.3 "Capture"
cordova-plugin-media 5.0.4-dev "Media"
cordova-plugin-native-logs 1.0.5 "Native Logs"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 3.0.0 "Network Information"
cordova-plugin-purchase 10.5.0 "Purchase"
cordova-plugin-sign-in-with-apple 0.1.2 "cordova-plugin-sign-in-with-apple"
cordova-plugin-statusbar 3.0.0-dev "StatusBar"
cordova-plugin-video-editor 1.1.3 "VideoEditor"
cordova-plugin-x-socialsharing 6.0.3 "SocialSharing"
cordova-sqlite-storage 6.0.0 "Cordova SQLite storage plugin - cordova-sqlite-storage plugin version"
cordova.plugins.diagnostic 6.1.1 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
pushy-cordova-receiver 1.0.0 "Pushy SDK Receiver for Cordova"
pushy-cordova 1.0.40 "PushySDK"

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

Current behavior: On iOS 13 using map.animateCamera after the map is tapped causes the map to be animated such that the tapped location is at the top left edge of the map instead of the center. My code puts a marker at the tapped location so I can see where it should be, but the marker moves elsewhere. You can see in this video

Expected behavior:

The map should animate to the location I specified without adjusting to another location.

Screen capture or video record: https://drive.google.com/file/d/1AlZ4_FooDPw5kA7vegH91aVTo5S0uJ_q/view?usp=sharing

[Android] $> adb shell screenrecord /sdcard/capture.mp4 $> adb pull /sdcard/capture.mp4 ./ [iOS] Use QuickTimer player on Mac --->

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

plugin.google.maps.event.MAP_CLICK, function (latLng) {
                    if (cb) {
                        return cb(latLng);
                    }
                })
function cb(latLng) {
        map.clear();
        map.addMarker(
            {
                position: latLng,
                title: title,
                snippet: snippet,
                icon: image,
                markerClick: function (marker) {
                    marker.showInfoWindow();
                },
            },
            function (marker) {
                    map.animateCamera(
                        {
                            target: latLng,
                            // zoom: globals.defaultMapZoom,
                            duration: globals.mapZoomDuration,
                        },
                        function () {
                            someOtherFunc(lat, lng);
                        }
                    );
                }
            }
        );
}

Support this plugin activity

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