AnsweredAssumed Answered

Use Pointcluster with State Plane coordinates

Question asked by gopre400 on Nov 19, 2015
Latest reply on Nov 20, 2015 by gopre400

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) {

}

 

 

Outcomes