Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for missing clusters on printout #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions PointClustering/ClusterFeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ define([
this._singleRenderer = options.singleRenderer;

this._objectIdField = options.objectIdField || 'OBJECTID';

this._opacity = options.hasOwnProperty('opacity') ? options.opacity : 1;

if (!this.url) {
throw new Error('url is a required parameter');
}
Expand Down Expand Up @@ -283,9 +284,10 @@ define([

renderer.addBreak(2, 10, small);
renderer.addBreak(10, 25, medium);
renderer.addBreak(25, Infinity, large);
renderer.addBreak(25, 10000, large);
this.setRenderer(renderer);
}
this.setOpacity(this._opacity);
this._reCluster();
}));
}
Expand Down Expand Up @@ -638,7 +640,7 @@ define([
}

// show number of points in the cluster
var label = new TextSymbol(c.attributes.clusterCount)
var label = new TextSymbol(c.attributes.clusterCount.toString())
.setColor(new Color(this._clusterLabelColor))
.setOffset(0, this._clusterLabelOffset)
.setFont(this._font);
Expand Down Expand Up @@ -687,7 +689,7 @@ define([
if ( label.length == 1 ) {
// console.log('update label...found: ', label);
this.remove(label[0]);
var newLabel = new TextSymbol(c.attributes.clusterCount)
var newLabel = new TextSymbol(c.attributes.clusterCount.toString())
.setColor(new Color(this._clusterLabelColor))
.setOffset(0, this._clusterLabelOffset)
.setFont(this._font);
Expand Down