4
4
5
5
/**
6
6
* @name DataLayerClusterer for Google Maps v3
7
- * @version version 0.7.1
7
+ * @version version 0.7.2
8
8
* @author Nelson Antunes
9
9
*
10
10
* The library creates and manages per-zoom-level clusters for large amounts of
@@ -570,7 +570,7 @@ function FeatureCluster(featureClusterer) {
570
570
571
571
this . bounds_ = null ;
572
572
573
- this . clusterIcon_ = new ClusterIcon ( this , featureClusterer . getStyles ( ) ,
573
+ this . clusterIcon_ = new FeatureClusterIcon ( this , featureClusterer . getStyles ( ) ,
574
574
featureClusterer . getGridSize ( ) ) ;
575
575
}
576
576
@@ -783,8 +783,8 @@ FeatureCluster.prototype.updateIcon = function() {
783
783
* @constructor
784
784
* @extends google.maps.OverlayView
785
785
*/
786
- function ClusterIcon ( cluster , styles , opt_padding ) {
787
- DataLayerClusterer . extend ( ClusterIcon , google . maps . OverlayView ) ;
786
+ function FeatureClusterIcon ( cluster , styles , opt_padding ) {
787
+ DataLayerClusterer . extend ( FeatureClusterIcon , google . maps . OverlayView ) ;
788
788
789
789
this . styles_ = styles ;
790
790
this . padding_ = opt_padding || 0 ;
@@ -804,7 +804,7 @@ function ClusterIcon(cluster, styles, opt_padding) {
804
804
/**
805
805
* Hide the icon.
806
806
*/
807
- ClusterIcon . prototype . hide = function ( ) {
807
+ FeatureClusterIcon . prototype . hide = function ( ) {
808
808
if ( this . div_ ) {
809
809
this . div_ . style . display = 'none' ;
810
810
}
@@ -814,7 +814,7 @@ ClusterIcon.prototype.hide = function() {
814
814
/**
815
815
* Position and show the icon.
816
816
*/
817
- ClusterIcon . prototype . show = function ( ) {
817
+ FeatureClusterIcon . prototype . show = function ( ) {
818
818
if ( this . div_ ) {
819
819
var pos = this . getPosFromLatLng_ ( this . center_ ) ;
820
820
this . div_ . style . cssText = this . createCss ( pos ) ;
@@ -826,7 +826,7 @@ ClusterIcon.prototype.show = function() {
826
826
/**
827
827
* Remove the icon from the map
828
828
*/
829
- ClusterIcon . prototype . remove = function ( ) {
829
+ FeatureClusterIcon . prototype . remove = function ( ) {
830
830
this . setMap ( null ) ;
831
831
} ;
832
832
@@ -835,7 +835,7 @@ ClusterIcon.prototype.remove = function() {
835
835
*
836
836
* @param {google.maps.LatLng } center The latlng to set as the center.
837
837
*/
838
- ClusterIcon . prototype . setCenter = function ( center ) {
838
+ FeatureClusterIcon . prototype . setCenter = function ( center ) {
839
839
this . center_ = center ;
840
840
} ;
841
841
@@ -846,7 +846,7 @@ ClusterIcon.prototype.setCenter = function(center) {
846
846
* Adding the cluster icon to the dom.
847
847
* @ignore
848
848
*/
849
- ClusterIcon . prototype . onAdd = function ( ) {
849
+ FeatureClusterIcon . prototype . onAdd = function ( ) {
850
850
this . div_ = document . createElement ( 'DIV' ) ;
851
851
if ( this . visible_ ) {
852
852
var pos = this . getPosFromLatLng_ ( this . center_ ) ;
@@ -867,7 +867,7 @@ ClusterIcon.prototype.onAdd = function() {
867
867
* Draw the icon.
868
868
* @ignore
869
869
*/
870
- ClusterIcon . prototype . draw = function ( ) {
870
+ FeatureClusterIcon . prototype . draw = function ( ) {
871
871
if ( this . visible_ ) {
872
872
var pos = this . getPosFromLatLng_ ( this . center_ ) ;
873
873
this . div_ . style . top = pos . y + 'px' ;
@@ -879,7 +879,7 @@ ClusterIcon.prototype.draw = function() {
879
879
* Implementation of the onRemove interface.
880
880
* @ignore
881
881
*/
882
- ClusterIcon . prototype . onRemove = function ( ) {
882
+ FeatureClusterIcon . prototype . onRemove = function ( ) {
883
883
if ( this . div_ && this . div_ . parentNode ) {
884
884
this . hide ( ) ;
885
885
this . div_ . parentNode . removeChild ( this . div_ ) ;
@@ -893,7 +893,7 @@ ClusterIcon.prototype.onRemove = function() {
893
893
/**
894
894
* Triggers the clusterclick event and zoom's if the option is set.
895
895
*/
896
- ClusterIcon . prototype . triggerClusterClick = function ( ) {
896
+ FeatureClusterIcon . prototype . triggerClusterClick = function ( ) {
897
897
var featureClusterer = this . cluster_ . getDataLayerClusterer ( ) ;
898
898
899
899
// Trigger the clusterclick event.
@@ -912,7 +912,7 @@ ClusterIcon.prototype.triggerClusterClick = function() {
912
912
* @return {google.maps.Point } The position in pixels.
913
913
* @private
914
914
*/
915
- ClusterIcon . prototype . getPosFromLatLng_ = function ( latlng ) {
915
+ FeatureClusterIcon . prototype . getPosFromLatLng_ = function ( latlng ) {
916
916
var pos = this . getProjection ( ) . fromLatLngToDivPixel ( latlng ) ;
917
917
pos . x -= parseInt ( this . width_ / 2 , 10 ) ;
918
918
pos . y -= parseInt ( this . height_ / 2 , 10 ) ;
@@ -925,7 +925,7 @@ ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
925
925
* @param {google.maps.Point } pos The position.
926
926
* @return {string } The css style text.
927
927
*/
928
- ClusterIcon . prototype . createCss = function ( pos ) {
928
+ FeatureClusterIcon . prototype . createCss = function ( pos ) {
929
929
var style = [ ] ;
930
930
style . push ( 'background-image:url(' + this . url_ + ');' ) ;
931
931
var backgroundPosition = this . backgroundPosition_ ? this . backgroundPosition_ : '0 0' ;
@@ -964,7 +964,7 @@ ClusterIcon.prototype.createCss = function(pos) {
964
964
/**
965
965
* Sets the icon to the the styles.
966
966
*/
967
- ClusterIcon . prototype . useStyle = function ( ) {
967
+ FeatureClusterIcon . prototype . useStyle = function ( ) {
968
968
var index = Math . max ( 0 , this . sums_ . index - 1 ) ;
969
969
index = Math . min ( this . styles_ . length - 1 , index ) ;
970
970
var style = this . styles_ [ index ] ;
@@ -984,7 +984,7 @@ ClusterIcon.prototype.useStyle = function() {
984
984
* 'text': (string) The text to display in the icon.
985
985
* 'index': (number) The style index of the icon.
986
986
*/
987
- ClusterIcon . prototype . setSums = function ( sums ) {
987
+ FeatureClusterIcon . prototype . setSums = function ( sums ) {
988
988
this . sums_ = sums ;
989
989
this . text_ = sums . text ;
990
990
this . index_ = sums . index ;
0 commit comments