Does anyone have an example to point me in the right direction to utilize Clustering with the ESRI JS API working with a State Plane wkid: 2236? I want to provide a solution for an internal application just like the demo on ESRI JS website. Though, all our data and the application I'm supposed to update is defined wkid:2236. I've tried modding the demo code though either I'm overlooking something or it's not possible. If this isn't possible any suggestions?

I had overlooked the "spatialReference" option within the constructor. This gets me to the point of displaying the cluster symbols on the map. Though, when I click the symbol I received the following error and I included the call stack. Any ideas?


<br />
var initExtent = new esri.geometry.Extent({ "xmin": **432163.89125**, "ymin": **1451074.4432**, "xmax": **710435.747749999**, "ymax": **1626999.3528**, "spatialReference": { "wkid": **2236** } });<br />
...<br />
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("**http://gisserver/ArcGIS/rest/services/BaseMap/MapServer/**");<br />
...<br />
var photos = esri.request({<br />
                    "url": "**js/testdata.json**",<br />
                    "handleAs": "json"<br />
                });<br />
...<br />
 clusterLayer = new extras.ClusterLayer({<br />
                "data": photoInfo.data,<br />
                "distance": 100,<br />
                "id": "clusters",<br />
                "labelColor": "#fff",<br />
                "labelOffset": 10,<br />
                **"spatialReference":"2236"**,<br />
                "resolution": map.extent.getWidth() / map.width,<br />
                "singleColor": "#888",<br />
                "singleTemplate": popupTemplate<br />
            });<br />
<br />

Unhandled exception at line 34, column 167548 in http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1

0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'toJson'


toJson [arcgis] Line 34 Script
updateHighlight [PopupBase.js] Line 19 Script
onSelectionChange [Popup.js] Line 19 Script
select [PopupBase.js] Line 19 Script
_updateFeatures [PopupBase.js] Line 19 Script
setFeatures [PopupBase.js] Line 19 Script
_2b5 [arcgis] Line 15 Script
setFeatures [Popup.js] Line 19 Script
_addSingles [eval code] Line 275 Script
onClick [eval code] Line 126 Script
advice [arcgis] Line 15 Script
_504 [arcgis] Line 15 Script
_onClickHandler [arcgis] Line 34 Script
Anonymous Function [arcgis] Line 15 Script

  • Do you have a link tag to the popup css?
    – theJones
    Commented Sep 13, 2012 at 21:05

1 Answer 1



Did you try putting it in the constructor? From Esri - SpatialReference. Optional. Spatial reference for all graphics in the layer. This has to match the spatial reference of the map. Default is 102100. Omit this if the map uses basemaps in web mercator.

clusterLayer = new extras.ClusterLayer({ 
      "data": photoInfo.data,
      "distance": 100,
      "id": "clusters", 
      "labelColor": "#fff",
      "labelOffset": 10,
      "resolution": map.extent.getWidth() / map.width,
      "singleColor": "#888",
      "singleTemplate": popupTemplate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.