ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

MARKER_CLICK not fired on iOS #224

Closed YoannRu closed 4 years ago

YoannRu commented 5 years ago

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

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

branch-cordova-sdk 3.1.5 "branch-cordova-sdk"
call-number 0.0.2 "Cordova Call Number Plugin"
com.testfairy.cordova-plugin 2.14.0 "TestFairy Plugin"
cordova-android-support-gradle-release 1.4.7 "cordova-android-support-gradle-release"
cordova-clipboard 1.2.1 "Clipboard"
cordova-open-native-settings 1.5.2 "Native settings"
cordova-pdf-generator 2.0.4 "PDFGenerator"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-crop 0.3.1 "CropPlugin"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer"
cordova-plugin-email-composer 0.8.15 "EmailComposer"
cordova-plugin-facebook4 3.2.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-google-analytics 1.8.6 "Google Universal Analytics Plugin"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-headercolor 1.0 "HeaderColor"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.2.5 "cordova-plugin-ionic-webview"
cordova-plugin-market 1.2.0 "Market"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-stripe 1.5.3 "cordova-plugin-stripe"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.3 "SocialSharing"
cordova-sms-plugin 1.0.0 "Cordova SMS Plugin"
cordova.plugins.diagnostic 4.0.10 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
onesignal-cordova-plugin 2.4.6 "OneSignal Push Notifications"

Package.json :

    "@ionic-native/core": "^4.20.0",
    "@ionic-native/google-maps": "^4.21.0",
    "cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps",

config.xml :

    <plugin name="cordova-plugin-googlemaps" spec="git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#multiple_maps">
        <variable name="PLAY_SERVICES_VERSION" value="15.0.1" />
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>

Hello, First of all thanks for the plugin.

I share a problem that I have been trying to solve for several days but to no avail.

The problem is that the MARKER_CLICK event is not caught on iOS only. I use markers cluster, and on Android everything works fine. Unfortunately no error or output appear on ios, but nothing happens when I click on the pin.

Can you help me please ?

let markerCluster = this.map.addMarkerClusterSync(optionsCluster);

  // TRY METHOD 1 -> Working on Android not iOS
    markerCluster.addEventListener(GoogleMapsEvent.MARKER_CLICK).subscribe(res => {
      console.log('MarkerClick catched METHOD 1');
    });

   // TRY METHOD 2 -> Working on Android not iOS
    markerCluster.on(GoogleMapsEvent.MARKER_CLICK).subscribe((params) => {
      console.log('MarkerClick catched solution 2'); 
   // DOING MY STUFF
    }, err => console.log(err));

When I click on a pin, autoPan is working correctly, but i can't catch the event on IOS. I try with a classic marker, event is not fired too.

Thanks,

wf9a5m75 commented 5 years ago

Please share your project files on GitHub repository.

YoannRu commented 5 years ago

Thank you for your reply.

For security reasons, I can not pass you all the project. What I'm going to do is create another project with only the code concerning google maps. I'll keep you informed when I'll have it.

I have a question, in my PodFile I have:     pod 'GoogleMaps', '~> 2.7.0'

Is this the correct version?

Have a good day

sameer123ahmed commented 5 years ago

how u run on android or ios because i have run in browser but dont know how to run on device

ruisilva450 commented 5 years ago

how u run on android or ios because i have run in browser but dont know how to run on device

This is offtopic but you could use ionic cordova run android as stated on the docs