Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thanks.


Thank you. 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?

CHANGES TO ESRI POINT CLUSTERING EXAMPLE

<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 />

ERROR
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'

CALL STACK

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

share|improve this question
    
Do you have a link tag to the popup css? –  theJones Sep 13 '12 at 21:05
add comment

1 Answer 1

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/layers_point_clustering.html

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,
      "spatialReference":"YourValueHere",
      "resolution": map.extent.getWidth() / map.width,
      "singleColor": "#888",
      "singleTemplate": popupTemplate
    });
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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