Skip to content

Commit

Permalink
0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Aug 3, 2019
1 parent 56a8b84 commit 312b9da
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
22 changes: 18 additions & 4 deletions dist/maptalks.markercluster.es.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* maptalks.markercluster v0.8.2
* maptalks.markercluster v0.8.3
* LICENSE : MIT
* (c) 2016-2018 maptalks.org
* (c) 2016-2019 maptalks.org
*/
/*!
* requires maptalks@>=0.26.3
Expand Down Expand Up @@ -267,6 +267,16 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {
}
};

_class.prototype.onGeometryShow = function onGeometryShow() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryShow.apply(this, arguments);
};

_class.prototype.onGeometryHide = function onGeometryHide() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryHide.apply(this, arguments);
};

_class.prototype.onGeometryAdd = function onGeometryAdd() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryAdd.apply(this, arguments);
Expand Down Expand Up @@ -443,10 +453,11 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {

if (this.layer.options['drawClusterText'] && cluster['textSize']) {
Canvas.prepareCanvasFont(ctx, this._textSymbol);
ctx.textBaseline = 'middle';
var dx = this._textSymbol['textDx'] || 0;
var dy = this._textSymbol['textDy'] || 0;
var text = this._getClusterText(cluster);
Canvas.fillText(ctx, text, pt.sub(cluster['textSize']).add(dx, dy));
Canvas.fillText(ctx, text, pt.sub(cluster['textSize'].x, 0)._add(dx, dy));
}
ctx.globalAlpha = opacity;
};
Expand All @@ -472,6 +483,9 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {
var extent = void 0,
c = void 0;
this.layer.forEach(function (g) {
if (!g.isVisible()) {
return;
}
c = g._getPrjCoordinates();
if (!extent) {
extent = g._getPrjExtent();
Expand Down Expand Up @@ -676,4 +690,4 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {

export { ClusterLayer };

typeof console !== 'undefined' && console.log('maptalks.markercluster v0.8.2, requires maptalks@>=0.26.3.');
typeof console !== 'undefined' && console.log('maptalks.markercluster v0.8.3, requires maptalks@>=0.26.3.');
22 changes: 18 additions & 4 deletions dist/maptalks.markercluster.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* maptalks.markercluster v0.8.2
* maptalks.markercluster v0.8.3
* LICENSE : MIT
* (c) 2016-2018 maptalks.org
* (c) 2016-2019 maptalks.org
*/
/*!
* requires maptalks@>=0.26.3
Expand Down Expand Up @@ -271,6 +271,16 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {
}
};

_class.prototype.onGeometryShow = function onGeometryShow() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryShow.apply(this, arguments);
};

_class.prototype.onGeometryHide = function onGeometryHide() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryHide.apply(this, arguments);
};

_class.prototype.onGeometryAdd = function onGeometryAdd() {
this._clusterNeedRedraw = true;
_maptalks$renderer$Ve.prototype.onGeometryAdd.apply(this, arguments);
Expand Down Expand Up @@ -447,10 +457,11 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {

if (this.layer.options['drawClusterText'] && cluster['textSize']) {
maptalks.Canvas.prepareCanvasFont(ctx, this._textSymbol);
ctx.textBaseline = 'middle';
var dx = this._textSymbol['textDx'] || 0;
var dy = this._textSymbol['textDy'] || 0;
var text = this._getClusterText(cluster);
maptalks.Canvas.fillText(ctx, text, pt.sub(cluster['textSize']).add(dx, dy));
maptalks.Canvas.fillText(ctx, text, pt.sub(cluster['textSize'].x, 0)._add(dx, dy));
}
ctx.globalAlpha = opacity;
};
Expand All @@ -476,6 +487,9 @@ ClusterLayer.registerRenderer('canvas', function (_maptalks$renderer$Ve) {
var extent = void 0,
c = void 0;
this.layer.forEach(function (g) {
if (!g.isVisible()) {
return;
}
c = g._getPrjCoordinates();
if (!extent) {
extent = g._getPrjExtent();
Expand Down Expand Up @@ -682,6 +696,6 @@ exports.ClusterLayer = ClusterLayer;

Object.defineProperty(exports, '__esModule', { value: true });

typeof console !== 'undefined' && console.log('maptalks.markercluster v0.8.2, requires maptalks@>=0.26.3.');
typeof console !== 'undefined' && console.log('maptalks.markercluster v0.8.3, requires maptalks@>=0.26.3.');

})));
6 changes: 3 additions & 3 deletions dist/maptalks.markercluster.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maptalks.markercluster",
"version": "0.8.2",
"version": "0.8.3",
"description": "A layer of maptalks to cluster markers.",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit 312b9da

Please sign in to comment.