Select to view content in your preferred language

DrawTool Error

2060
10
04-20-2011 08:12 AM
RobertScheitlin__GISP
MVP Emeritus
I have been working to diagnose this error for 2 days now and thought I would see if any one could give me a clue as to where to look or what to check in my app that is causing this issue.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.ags.tools::DrawTool/checkForSnapping()
at com.esri.ags.tools::DrawTool/map_mouseMoveFirstHandler()
Tags (2)
0 Kudos
10 Replies
SarthakDatt
Frequent Contributor
Robert,

Are you using some projection other than web mercator or geographic? If you are using either one of them, then can you make sure that the spatialReference is set properly/correctly?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sarthak,

   I am using wkid="102629" as I am only using my local data. I do not specifically set this anywhere in the code.
0 Kudos
SarthakDatt
Frequent Contributor
The snapping functionality right now,unfortunately is relying on the wkid to be 102113,102100,3857(web mercator) and 4326(geographic).

This is a bug right now, and would be fixed in the next version.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sarthak,

   So for those of us that are using different WKIDs is there anything we can do to avoid the error when someone is using the drawing tool and presses the ctrl key?
0 Kudos
SarthakDatt
Frequent Contributor
You can set the snapDistance = 0 (http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tools/DrawTool.html#snapDistance), this would turn off snapping and hence not throw the error.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sarthak,

   Thanks for the info. That issue would have definitely kept me from using the new 2.3 API, now a can just move forward with the other great enhancements and wait for you guys to get snapping working for those using more location specific WKIDs.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sarthak,

   Well I guess I spoke to early... Now I get this error when I use the EditTool and my wkid.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.esri.ags.tools::EditTool/map_mouseMoveHandler()
0 Kudos
SarthakDatt
Frequent Contributor
The reason for the error is the same and I guess it is happening when you are trying to add new vertices to an existing polygon/polyline.

I know this would take out the functionality of adding vertices to existing features, but can you try setting EditTool.allowAddVertices(http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tools/EditTool.html#allowAddVertices) to false to see if the error goes away?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sarthak,

   That does remove the error, but these small steps backwards is not looking to good for this API release... Maybe these bugs will encourage a quick re-release. Thanks for your help in diagnosing this issue.
0 Kudos