I've used the point clusterer with ArcGIS base maps where I store the x,y in that spatial reference. I would like to use the tool with x,y stores in State Plane coordinates of Washington (spatial reference 2926). I am having problems getting it to work. The cluster points show up in Algeria (not Washington). What am I missing?
function addClusters(resp) {
var obj = jQuery.parseJSON(resp.d);
var photoInfo = {};
var wgs = new SpatialReference({
"wkid": 2926
var photocnt = 0;
function (p) {
var rec = p.split(";");
var latlng = new Point(parseFloat(rec[1]), parseFloat(rec[2]), wgs);
var attributes = {
"RequestID": rec[0]
return {
"x": latlng.x,
"y": latlng.y,
"attributes": attributes
var popupTemplate = new PopupTemplate();
"");
"<b>ID:</b>${RequestID}<br/>" +
"<b>Type:</b><br/>" +
"<a rel='external' target='_blank' href='SWUViewInspectionDetail.htm?id=${ID}'>Details</a>");
// cluster layer that uses OpenLayers style clustering
new ClusterLayer({
"data": photoInfo.data,
"distance": 50,
"id": "clusters",
"labelColor": "#fff",
"labelOffset": 10,
"resolution": map.extent.getWidth() / map.width,
"singleColor": "#888",
"singleTemplate": popupTemplate
var defaultSym = new SimpleMarkerSymbol().setSize(4);
var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
var picBaseUrl = "http://static.arcgis.com/images/Symbols/Shapes/";
var blue = new PictureMarkerSymbol(picBaseUrl + "BluePin1LargeB.png", 32, 32).setOffset(0, 15);
var green = new PictureMarkerSymbol(picBaseUrl + "GreenPin1LargeB.png", 64, 64).setOffset(0, 15);
var red = new PictureMarkerSymbol(picBaseUrl + "RedPin1LargeB.png", 72, 72).setOffset(0, 15);
// close the info window when the map is clicked
"click", cleanUp);
// close the info window when esc is pressed
"key-down", function (e) {
if (e.keyCode === 27) {
}
The problems appears to be that spatial reference of map is 2926 but spatial reference of cluster layer is 4326. I have tried setting the spatial reference of cluster layer with no luck.
new ClusterLayer({
"data": photoInfo.data,
"distance": 50,
"id": "clusters",
"labelColor": "#fff",
"spatialReference": new esri.SpatialReference({ "wkid": 2926 }),
"labelOffset": 10,
"resolution": map.extent.getWidth() / map.width,
"singleColor": "#888",
"singleTemplate": popupTemplate