Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANDROID] [Feature] - Ability to change clickability of POI #2779

Closed
wants to merge 2 commits into from

Conversation

ebhsgit
Copy link
Contributor

@ebhsgit ebhsgit commented May 20, 2020

This PR introduce the ability to change whether POI is clickable.

If the developer does not want interactions with POI, currently, the plugin can only hide the POI by setting map styles.
This give the developer more flexibly on how to handle POI on their map.

Use case
Sometime tapping on Polyline does not register. This is due to the tap position being near a POI. The POI registers the clicking event instead of the Polyline.

Pull request guide

Thank you for considering to improve this cordova-plugin-googlemaps.

When you create a pull request, please make it to multiple_maps branch instead of master branch.

Because the multiple_maps branch is edge version.

Thank you for your understanding.


@wf9a5m75
master branch has changes that is ahead of multiple_maps branch. Creating a PR into multiple_maps will also bring these changes.

@wf9a5m75
Copy link
Member

Since Google Maps JS v3 does not have the name of method setClickablePOI, I don't accept this style way.
The goal of this plugin is to reproduce the Google Maps JS v3 as much as possible.

I'm implementing mapOptions.preferences.clickableIcons option more better way. I will let you know the code is ready.

@wf9a5m75
Copy link
Member

wf9a5m75 commented May 20, 2020

mapOptions.preferences.clickableIcons = true/false is now available on the multiple_maps branch code.

var map = plugin.google.maps.getMap('map_canvas', {
      'camera': {
         ...
      },
      'preferences': {
        'clickableIcons': false
      }
    });

map.on(plugin.google.maps.event.POI_CLICK, function() {
    console.log("poi_clicked");  // this code is not invited when `clickableIcons = false`
});

@wf9a5m75 wf9a5m75 closed this May 20, 2020
@ebhsgit
Copy link
Contributor Author

ebhsgit commented May 20, 2020

Thanks mate

@wf9a5m75
Copy link
Member

  public void onPoiClick(PointOfInterest pointOfInterest) {
    if (!this.clickableIcons) {
      this.onMapClick(pointOfInterest.latLng);
      return;
    }

@ebhsgit
Copy link
Contributor Author

ebhsgit commented May 20, 2020

Yep. Noticed that after my previous comment :)

paulnagle pushed a commit to paulnagle/cordova-plugin-googlemaps that referenced this pull request Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants