Permalink
Browse files

Merge pull request #28 from JDeuce/c4b29f532dc28a976420c4a642b245921a…

…099c6f

Append an offset to the cluster image
  • Loading branch information...
2 parents 484c564 + c4b29f5 commit 569e722092ea5158169d27bad636ec0e6c968798 @jbdemonte committed Apr 13, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 gmap3.js
View
7 gmap3.js
@@ -1528,7 +1528,7 @@
this._displayClusters = function(todo, clusterer, clusters, same, styles){
var k, i, ii, m, done, obj, shadow, cluster, options, tmp, w, h,
- atodo,
+ atodo, offset,
ctodo = hasKey(todo, 'cluster') ? getObject('', ival(todo, 'cluster')) : {},
mtodo = hasKey(todo, 'marker') ? getObject('', ival(todo, 'marker')) : {};
for(i=0; i<clusters.length; i++){
@@ -1548,6 +1548,7 @@
if (styles[m]){ // cluster defined for the current markers count
w = ival(styles[m], 'width');
h = ival(styles[m], 'height');
+ offset = ival(styles[m], 'offset') || [-w/2, -h/2];
// create a custom _addOverlay command
atodo = {};
@@ -1559,8 +1560,8 @@
pane: 'overlayLayer',
content:styles[m].content.replace('CLUSTER_COUNT', cluster.idx.length),
offset:{
- x: -w/2,
- y: -h/2
+ x: offset[0],
+ y: offset[1]
}
}
}

0 comments on commit 569e722

Please sign in to comment.