NateRickard / Google-Maps-Utils-Binding

This is a set of Xamarin bindings for the Utility Library for Google Maps SDK for iOS (google-maps-ios-utils)
MIT License
7 stars 7 forks source link

Proyect doesn´t work #7

Open jposes22 opened 6 years ago

jposes22 commented 6 years ago

I try to use this binding with Nuget but doesn´t work. @Yogeshk25 make a branch and works fine but the following Delegate function doesnt´t work too...

public void DidTapClusterItem(GMUClusterManager clusterManager, IGMUClusterItem clusterItem) {}

Can you help me please :)?

captura de pantalla 2018-02-16 a las 14 05 48

yogeshk25 commented 6 years ago

Well for me it does work. Do not forget to implement IGMUClusterManagerDelegate on your class.

[Export("clusterManager:didTapClusterItem:")] public void DidTapClusterItem(GMUClusterManager clusterManager, IGMUClusterItem clusterItem) { POIItem poitem = clusterItem as POIItem; }

jposes22 commented 6 years ago

I´ve implemented

IGMUClusterManagerDelegate clusterManager.SetDelegate (this, this);

The first function works fine:

[Export ("clusterManager:didTapCluster:")] public void DidTapCluster (GMUClusterManager clusterManager, IGMUCluster cluster)

The problem is only DidTapClusterItem.

I make a native proyect and works all. I was a video if you want: https://drive.google.com/drive/folders/1Kh3Q5iWygYAqHVjXTNUZ6nPKzaLwjt4Q?usp=sharing (you can download video with internet explorer, I don´t know why chrome doesnt work ;( )

simon25608 commented 6 years ago

I have the same problem :(

ghost commented 6 years ago

I have the same problem

ghost commented 6 years ago

I think the binding is wrong mapped. The return type of this methods should be bool

[Export ("clusterManager:didTapCluster:")]
void DidTapCluster (GMUClusterManager clusterManager, IGMUCluster cluster);

[Export ("clusterManager:didTapClusterItem:")]
void DidTapClusterItem (GMUClusterManager clusterManager, IGMUClusterItem clusterItem);

In the native code from google maps repository:

   /**
   * Called when the user taps on a cluster marker.
   * @return YES if this delegate handled the tap event,
   * and NO to pass this tap event to other handlers.
   */
   - (BOOL)clusterManager:(GMUClusterManager *)clusterManager didTapCluster (id<GMUCluster>)cluster;
    
   /**
   * Called when the user taps on a cluster item marker.
   * @return YES if this delegate handled the tap event,
   * and NO to pass this tap event to other handlers.
   */
   - (BOOL)clusterManager:(GMUClusterManager *)clusterManager didTapClusterItem:(id<GMUClusterItem>)clusterItem;
yogeshk25 commented 6 years ago

Soon I'll try to setup a sample project just to demonstrate that it works for me, I am already using it in a production app. And both this functions work for me. I hope you guys are using already published plugin on nuget https://www.nuget.org/packages/Xamarin.iOS.Maps.Utils

yogeshk25 commented 6 years ago

Here's a working sample of this plugin, demonstrating DidTapCluster and DidTapClusterItem. https://github.com/Yogeshk25/Google.Maps.Utils.Sample