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

Use the MarkerClusterer library instead of ClusterMarker #381

Closed
GoogleCodeExporter opened this issue Apr 4, 2015 · 22 comments
Closed

Use the MarkerClusterer library instead of ClusterMarker #381

GoogleCodeExporter opened this issue Apr 4, 2015 · 22 comments

Comments

@GoogleCodeExporter
Copy link

This test page makes it look like performance is better with MarkerClusterer, 
especially with a lot of markers:

http://www.svennerberg.com/examples/markers/markerPerformance.html

Original issue reported on code.google.com by dylankk...@gmail.com on 25 Aug 2010 at 9:04

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision r735.

Made this a global maps option.

Original comment by dylankk...@gmail.com on 25 Aug 2010 at 9:08

  • Changed state: Implemented
  • Added labels: Milestone-1.4

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision r736.

Forgot to add the MarkerClusterer javascript! Now it should work.

Original comment by dylankk...@gmail.com on 25 Aug 2010 at 9:14

@GoogleCodeExporter
Copy link
Author

Hey Dylan,

Testing 1.4alpha8. Performance improvement of V3 maps is noticeable! 
Can't seem to get markerClusterer working? Does it require activation via 
custom.js?

Cheers
Ben

Original comment by bco...@gmail.com on 19 Oct 2010 at 7:30

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

There are a number of features that are still v2-only, including clustering. 
Ideally I'd like to implement some kind of server-side clustering that would 
work for all APIs moving forward, but I consider that a separate feature.

Original comment by dylankk...@gmail.com on 21 Oct 2010 at 11:52

@GoogleCodeExporter
Copy link
Author

I just found a tricky workaround to make cluster work in 1.4alpha.
In geo-mashup-custom.php add this code to load the library (placed in the 
custom plugin folder):

function my_script_check() {    
  global $geo_mashup_options;
  $map_api = $geo_mashup_options->get( 'overall', 'map_api' );
  if ('googlev3' == $map_api) {
      $basename = plugin_basename( __FILE__ );
      $dir_name = substr( $basename, 0, strpos( $basename, '/' ) );      
      wp_enqueue_script( 'google-maps-3-cluster-marker', '/wp-content/plugins/'.$dir_name.'/markerclusterer_packed.js', array( 'google-maps-3'));
    }  
} 
add_action( 'wp_print_scripts', 'my_script_check' );

then in custom.js:

// Override addMarkers to save google.maps.Markers
GeoMashup.propietary_markers = [];
GeoMashup.addMarkers = function( markers ) {
    this.forEach( markers, function( i, marker ) {
      this.map.addMarker( marker );
      GeoMashup.propietary_markers.push(marker.proprietary_marker);
    } );
};

GeoMashup.addAction( 'loadedMap', function ( opts, map )
{
  var markerCluster = new MarkerClusterer(map.maps[map.api], GeoMashup.propietary_markers);  
} ); 


Original comment by vcausar...@gmail.com on 21 Oct 2010 at 4:42

@GoogleCodeExporter
Copy link
Author

@vcausarano: Nice work! Based on this, maybe I can preserve clustering using 
MarkerClusterer in GM 1.4. 

Original comment by dylankk...@gmail.com on 21 Oct 2010 at 7:10

@GoogleCodeExporter
Copy link
Author

@dylan
Thanks! It means a lot as it's the first time I play with javascript.
The drawbacks using client side cluster is that MarkerClusterer seems to be 
very slow under IE and that it slow down the markers render after a zoom even 
when > maxZoom.

Original comment by vcausar...@gmail.com on 22 Oct 2010 at 11:10

@GoogleCodeExporter
Copy link
Author

hmm it seems that markercluster only works for visible markers.
so making it work with hide-show categories requires a lot of coding.

Original comment by vcausar...@gmail.com on 22 Oct 2010 at 3:03

@GoogleCodeExporter
Copy link
Author

Bummer - I bet that's an issue with v2 also, I'll have to test it. 

Are you interesting in working on Geo Mashup? If so, send me an email - Google 
code requires an email address for me to add you to the project. You can allow 
access to your email (as I have) in your Google code profile too.

Original comment by dylankk...@gmail.com on 22 Oct 2010 at 3:33

@GoogleCodeExporter
Copy link
Author

Related: http://code.google.com/p/wordpress-geo-mashup/issues/detail?id=407

Original comment by mamoun.d...@gmail.com on 30 Nov 2010 at 10:33

@GoogleCodeExporter
Copy link
Author

It's not looking like I'll solve this for Geo Mashup 1.4 - hopefully soon after.

Original comment by dylankk...@gmail.com on 4 Apr 2011 at 2:20

  • Changed state: Accepted
  • Removed labels: Milestone-1.4

@GoogleCodeExporter
Copy link
Author

I' m not sure if it is optimal but that would fix the hide-show category 
problem.

GeoMashup.recluster = function() {
    var point;
    var markers = [];

    for (point in this.locations) {
        if ( this.locations.hasOwnProperty( point ) && this.locations[point].marker ) {
            if( this.isMarkerOn( this.locations[point].marker )) {
                markers.push(this.locations[point].marker.proprietary_marker);
            }
        }
    }

    markerCluster.clearMarkers();
    markerCluster.addMarkers(markers);
};

Original comment by sprock...@gmail.com on 4 Nov 2012 at 1:28

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision e5209d2de4ff.

Got MarkerClusterer working! There has been lots of interest in this but
no financial support - donations would help to test, polish, and release it.

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11045324

Original comment by dylankk...@gmail.com on 24 Mar 2013 at 3:48

  • Changed state: Implemented
  • Added labels: Milestone-1.6

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision 4876cd27ad83.

Got MarkerClusterer working! There has been lots of interest in this but
no financial support - donations would help to test, polish, and release it.

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=11045324

Original comment by dylankk...@gmail.com on 28 Mar 2013 at 2:55

@GoogleCodeExporter
Copy link
Author

I just sent you a donation. Thanks for the great plugin and I look forward to 
this new release. Once it gets released I would love to send more.

Wade
http://5starcampgrounds.com


Original comment by wdra...@gmail.com on 28 Mar 2013 at 3:21

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision 4467b5b6096b.

Got it working in IE8 using a modernizr test. Beating my chest, arrrrghghghg!

Original comment by dylankk...@gmail.com on 30 Mar 2013 at 1:30

@GoogleCodeExporter
Copy link
Author

I've put up a beta release, test it out!

https://code.google.com/p/wordpress-geo-mashup/downloads/detail?name=geo-mashup-
1.6.0-beta1.zip

Original comment by dylankk...@gmail.com on 5 Apr 2013 at 9:09

@GoogleCodeExporter
Copy link
Author

Just testing not had time before now the clustering seems to work great thank 
you and yep definitely needs a donation many thanks Dylan!

Original comment by a...@intriguing-networks.com on 6 May 2013 at 7:26

@GoogleCodeExporter
Copy link
Author

Original comment by dylankk...@gmail.com on 10 Jul 2013 at 3:37

  • Changed state: Released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant