Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2d054a0

Browse files
committed
Refactors ClusterIcon to FeatureClusterIcon
1 parent 91e31c6 commit 2d054a0

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

‎bower.json‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "data-layer-clusterer",
3-
"version": "0.7.1",
4-
"homepage": "https://github.com/nantunes/data-layer-clusterer",
5-
"authors": [
6-
"Nelson Antunes"
7-
],
8-
"description": "The library creates and manages per-zoom-level clusters large amounts of data layer features. Google API v3.",
9-
"main": "src/datalayerclusterer.js",
10-
"keywords": [
11-
"google",
12-
"maps",
13-
"data",
14-
"layer",
15-
"marker",
16-
"cluster",
17-
"clusterer",
18-
"javascript",
19-
"js",
20-
"api",
21-
"v3"
22-
],
23-
"license": "Apache 2.0",
24-
"ignore": [
25-
"**/.*"
26-
]
2+
"name": "data-layer-clusterer",
3+
"version": "0.7.2",
4+
"homepage": "https://github.com/nantunes/data-layer-clusterer",
5+
"authors": [
6+
"Nelson Antunes"
7+
],
8+
"description": "The library creates and manages per-zoom-level clusters large amounts of data layer features. Google API v3.",
9+
"main": "src/datalayerclusterer.js",
10+
"keywords": [
11+
"google",
12+
"maps",
13+
"data",
14+
"layer",
15+
"marker",
16+
"cluster",
17+
"clusterer",
18+
"javascript",
19+
"js",
20+
"api",
21+
"v3"
22+
],
23+
"license": "Apache 2.0",
24+
"ignore": [
25+
"**/.*"
26+
]
2727
}

‎src/datalayerclusterer.js‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* @name DataLayerClusterer for Google Maps v3
7-
* @version version 0.7.1
7+
* @version version 0.7.2
88
* @author Nelson Antunes
99
*
1010
* The library creates and manages per-zoom-level clusters for large amounts of
@@ -570,7 +570,7 @@ function FeatureCluster(featureClusterer) {
570570

571571
this.bounds_ = null;
572572

573-
this.clusterIcon_ = new ClusterIcon(this, featureClusterer.getStyles(),
573+
this.clusterIcon_ = new FeatureClusterIcon(this, featureClusterer.getStyles(),
574574
featureClusterer.getGridSize());
575575
}
576576

@@ -783,8 +783,8 @@ FeatureCluster.prototype.updateIcon = function() {
783783
* @constructor
784784
* @extends google.maps.OverlayView
785785
*/
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);
788788

789789
this.styles_ = styles;
790790
this.padding_ = opt_padding || 0;
@@ -804,7 +804,7 @@ function ClusterIcon(cluster, styles, opt_padding) {
804804
/**
805805
* Hide the icon.
806806
*/
807-
ClusterIcon.prototype.hide = function() {
807+
FeatureClusterIcon.prototype.hide = function() {
808808
if (this.div_) {
809809
this.div_.style.display = 'none';
810810
}
@@ -814,7 +814,7 @@ ClusterIcon.prototype.hide = function() {
814814
/**
815815
* Position and show the icon.
816816
*/
817-
ClusterIcon.prototype.show = function() {
817+
FeatureClusterIcon.prototype.show = function() {
818818
if (this.div_) {
819819
var pos = this.getPosFromLatLng_(this.center_);
820820
this.div_.style.cssText = this.createCss(pos);
@@ -826,7 +826,7 @@ ClusterIcon.prototype.show = function() {
826826
/**
827827
* Remove the icon from the map
828828
*/
829-
ClusterIcon.prototype.remove = function() {
829+
FeatureClusterIcon.prototype.remove = function() {
830830
this.setMap(null);
831831
};
832832

@@ -835,7 +835,7 @@ ClusterIcon.prototype.remove = function() {
835835
*
836836
* @param {google.maps.LatLng} center The latlng to set as the center.
837837
*/
838-
ClusterIcon.prototype.setCenter = function(center) {
838+
FeatureClusterIcon.prototype.setCenter = function(center) {
839839
this.center_ = center;
840840
};
841841

@@ -846,7 +846,7 @@ ClusterIcon.prototype.setCenter = function(center) {
846846
* Adding the cluster icon to the dom.
847847
* @ignore
848848
*/
849-
ClusterIcon.prototype.onAdd = function() {
849+
FeatureClusterIcon.prototype.onAdd = function() {
850850
this.div_ = document.createElement('DIV');
851851
if (this.visible_) {
852852
var pos = this.getPosFromLatLng_(this.center_);
@@ -867,7 +867,7 @@ ClusterIcon.prototype.onAdd = function() {
867867
* Draw the icon.
868868
* @ignore
869869
*/
870-
ClusterIcon.prototype.draw = function() {
870+
FeatureClusterIcon.prototype.draw = function() {
871871
if (this.visible_) {
872872
var pos = this.getPosFromLatLng_(this.center_);
873873
this.div_.style.top = pos.y + 'px';
@@ -879,7 +879,7 @@ ClusterIcon.prototype.draw = function() {
879879
* Implementation of the onRemove interface.
880880
* @ignore
881881
*/
882-
ClusterIcon.prototype.onRemove = function() {
882+
FeatureClusterIcon.prototype.onRemove = function() {
883883
if (this.div_ && this.div_.parentNode) {
884884
this.hide();
885885
this.div_.parentNode.removeChild(this.div_);
@@ -893,7 +893,7 @@ ClusterIcon.prototype.onRemove = function() {
893893
/**
894894
* Triggers the clusterclick event and zoom's if the option is set.
895895
*/
896-
ClusterIcon.prototype.triggerClusterClick = function() {
896+
FeatureClusterIcon.prototype.triggerClusterClick = function() {
897897
var featureClusterer = this.cluster_.getDataLayerClusterer();
898898

899899
// Trigger the clusterclick event.
@@ -912,7 +912,7 @@ ClusterIcon.prototype.triggerClusterClick = function() {
912912
* @return {google.maps.Point} The position in pixels.
913913
* @private
914914
*/
915-
ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
915+
FeatureClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
916916
var pos = this.getProjection().fromLatLngToDivPixel(latlng);
917917
pos.x -= parseInt(this.width_ / 2, 10);
918918
pos.y -= parseInt(this.height_ / 2, 10);
@@ -925,7 +925,7 @@ ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
925925
* @param {google.maps.Point} pos The position.
926926
* @return {string} The css style text.
927927
*/
928-
ClusterIcon.prototype.createCss = function(pos) {
928+
FeatureClusterIcon.prototype.createCss = function(pos) {
929929
var style = [];
930930
style.push('background-image:url(' + this.url_ + ');');
931931
var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
@@ -964,7 +964,7 @@ ClusterIcon.prototype.createCss = function(pos) {
964964
/**
965965
* Sets the icon to the the styles.
966966
*/
967-
ClusterIcon.prototype.useStyle = function() {
967+
FeatureClusterIcon.prototype.useStyle = function() {
968968
var index = Math.max(0, this.sums_.index - 1);
969969
index = Math.min(this.styles_.length - 1, index);
970970
var style = this.styles_[index];
@@ -984,7 +984,7 @@ ClusterIcon.prototype.useStyle = function() {
984984
* 'text': (string) The text to display in the icon.
985985
* 'index': (number) The style index of the icon.
986986
*/
987-
ClusterIcon.prototype.setSums = function(sums) {
987+
FeatureClusterIcon.prototype.setSums = function(sums) {
988988
this.sums_ = sums;
989989
this.text_ = sums.text;
990990
this.index_ = sums.index;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /