UNPKG

googlemaps-v3-utility-library

Version:
277 lines (155 loc) 9.31 kB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>MarkerClusterer for Google Maps v3 version 1.0 Reference</title> <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link> <link rel="stylesheet" type="text/css" href="../../util/docs/template/local_extensions.css"></link> </head> <body> <h1>MarkerClusterer for Google Maps v3</h1> <p> The library creates and manages per-zoom-level clusters for large amounts of markers. <br/> This is a v3 implementation of the <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/" >v2 MarkerClusterer</a>.</p> <p>For a description and examples of how to use this library, check out the <a href="examples.html">how-to</a>.</p> <h2><a name="MarkerClusterer"></a>class MarkerClusterer</h2> <p> This class extends <code>google.maps.OverlayView</code>.</p> <h3>Constructor</h3> <table summary="class MarkerClusterer - Constructor" width="90%"> <tbody> <tr> <th>Constructor</th> <th>Description</th> </tr> <tr class="odd"> <td><code>MarkerClusterer(<span class="type">map:google.maps.Map</span>, <span class="type">opt_markers:Array.&lt;google.maps.Marker&gt;</span>, <span class="type">opt_options:Object</span>)</code></td> <td>A Marker Clusterer that clusters markers.</td> </tr> </tbody> </table> <h3>Methods</h3> <table summary="class MarkerClusterer - Methods" width="90%"> <tbody> <tr> <th>Methods</th> <th>Return&nbsp;Value</th> <th>Description</th> </tr> <tr class="odd"> <td><code>addMarker(<span class="type">marker:google.maps.Marker</span>, <span class="type">opt_nodraw:boolean</span>)</code></td> <td><code>None</code></td> <td>Adds a marker to the clusterer and redraws if needed.</td> </tr> <tr class="even"> <td><code>addMarkers(<span class="type">markers:Array.&lt;google.maps.Marker&gt;</span>, <span class="type">opt_nodraw:boolean</span>)</code></td> <td><code>None</code></td> <td>Add an array of markers to the clusterer.</td> </tr> <tr class="odd"> <td><code>clearMarkers()</code></td> <td><code>None</code></td> <td>Clears all clusters and markers from the clusterer.</td> </tr> <tr class="even"> <td><code>getCalculator()</code></td> <td><code>function(Array|number)</code></td> <td>Get the calculator function.</td> </tr> <tr class="odd"> <td><code>getExtendedBounds(<span class="type">bounds:google.maps.LatLngBounds</span>)</code></td> <td><code>google.maps.LatLngBounds</code></td> <td>Extends a bounds object by the grid size.</td> </tr> <tr class="even"> <td><code>getGridSize()</code></td> <td><code>number</code></td> <td>Returns the size of the grid.</td> </tr> <tr class="odd"> <td><code>getMap()</code></td> <td><code>google.maps.Map</code></td> <td>Returns the google map that the clusterer is associated with.</td> </tr> <tr class="even"> <td><code>getMarkers()</code></td> <td><code>Array.<google.maps.Marker></code></td> <td>Returns the array of markers in the clusterer.</td> </tr> <tr class="odd"> <td><code>getMaxZoom()</code></td> <td><code>number</code></td> <td>Gets the max zoom for the clusterer.</td> </tr> <tr class="even"> <td><code>getStyles()</code></td> <td><code>Object</code></td> <td>Gets the styles.</td> </tr> <tr class="odd"> <td><code>getTotalClusters()</code></td> <td><code>number</code></td> <td>Returns the number of clusters in the clusterer.</td> </tr> <tr class="even"> <td><code>getTotalMarkers()</code></td> <td><code>Array.<google.maps.Marker></code></td> <td>Returns the array of markers in the clusterer.</td> </tr> <tr class="odd"> <td><code>isZoomOnClick()</code></td> <td><code>boolean</code></td> <td>Whether zoom on click is set.</td> </tr> <tr class="even"> <td><code>redraw()</code></td> <td><code>None</code></td> <td>Redraws the clusters.</td> </tr> <tr class="odd"> <td><code>removeMarker(<span class="type">marker:google.maps.Marker</span>)</code></td> <td><code>boolean</code></td> <td>Remove a marker from the cluster.</td> </tr> <tr class="even"> <td><code>resetViewport()</code></td> <td><code>None</code></td> <td>Clears all existing clusters and recreates them.</td> </tr> <tr class="odd"> <td><code>setCalculator(<span class="type">calculator:function(Array|number)</span>)</code></td> <td><code>None</code></td> <td>Set the calculator function.</td> </tr> <tr class="even"> <td><code>setGridSize(<span class="type">size:number</span>)</code></td> <td><code>None</code></td> <td>Returns the size of the grid.</td> </tr> <tr class="odd"> <td><code>setMap(<span class="type">map:google.maps.Map</span>)</code></td> <td><code>None</code></td> <td>Sets the google map that the clusterer is associated with.</td> </tr> <tr class="even"> <td><code>setMaxZoom(<span class="type">maxZoom:number</span>)</code></td> <td><code>None</code></td> <td>Sets the max zoom for the clusterer.</td> </tr> <tr class="odd"> <td><code>setStyles(<span class="type">styles:Object</span>)</code></td> <td><code>None</code></td> <td>Sets the styles.</td> </tr> </tbody> </table> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript"> _uacct = "UA-964209-4"; urchinTracker(); </script> </body> </html>