Yankovsky / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

ClusterMarker/ClusterMarker plus don't work correctly with IOS #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

1. On the Ipod/Ipad select a cluster marker from 

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererpl
us/examples/simple_example.html

2. Zoom out until cluster marker returns,

3. Select the same marker, zoom in is not in the correct place

4. It is always off-center to the extent that the zoomed in markers do not show 
on screen.

5. As an extra quirk at step 2 if you drag the map in any direction when the 
cluster markers return, THEN select the marker, it WORKS !

Any help if poss, can I override anything until a fix is applied?

Harvey

Original issue reported on code.google.com by harvey.s...@steria.co.uk on 16 Apr 2012 at 1:24

GoogleCodeExporter commented 9 years ago
I can confirm this happens to us as well. To make things worse, we seem to lose 
the ability to click clusters in iPad if indeed you have already clicked one 
before.

Original comment by devinray...@gmail.com on 18 Apr 2012 at 9:01

GoogleCodeExporter commented 9 years ago
We got the answer.....We have always know that you had to call the fitbound 
method twice for IOS to work even for normal marker let alone ClusterMarkers.

We added this to the ClusterMarker.js code and it still didn't work, this was 
because by the time the second one ran the getbounds  method returned nothing, 
so we have saved it away and called again.

In ClusterMarker.js update the following method .... just cut and paste

ClusterIcon.prototype.triggerClusterClick = function () {

       var markerClusterer = this.cluster_.getMarkerClusterer();
       // Trigger the clusterclick event.
       google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_);

       if (markerClusterer.isZoomOnClick()) {
              // Zoom into the cluster.
              var theBounds = this.cluster_.getBounds();
              this.map_.fitBounds(theBounds);
              setTimeout(this.map_.fitBounds(theBounds), 100);
       }
};

Original comment by harvey.s...@steria.co.uk on 20 Apr 2012 at 1:06

GoogleCodeExporter commented 9 years ago
Harvey,

Thanks for the fix. Not sure why iOS requires two calls to fitbound but if it 
works, great!

I have modified the trunk release of MarkerClustererPlus to incorporate your 
fix. I will tag v2.0.12 soon.

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererpl
us/

gary

Original comment by garylitt...@gmail.com on 21 Apr 2012 at 3:26

GoogleCodeExporter commented 9 years ago
MarkerClustererPlus 2.0.12 has now been tagged and incorporates this fix.

(The original MarkerClusterer has not yet been fixed -- it's not my project. 
The fix that Harvey mentioned above still has to be applied if you're using the 
old MC.)

http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplu
s/2.0.12/

Original comment by garylitt...@gmail.com on 21 Apr 2012 at 3:37