Select to view content in your preferred language

Error in Enhanced Draw widget

3492
22
10-21-2010 04:00 PM
City_of_Port_Angeles_GIS
New Contributor III
Robert,
   I followed your instructions for integrating your enhanced draw widget into my Flex Viewer app
but I'm getting the following error:
Fault info: Error #1090: XML parser failure: element is malformed.
   I have not changed anything in your code. All search results on google refer to Action Script 3.
The problems window in Flash Builder 4 does not display any errors at all. Any ideas what could be causing this?
Bill
Tags (2)
0 Kudos
22 Replies
RobertScheitlin__GISP
MVP Emeritus
Bill,

  Something must have happened to the xml text you are putting into your config.xml or somehow the DrawWidget.xml has gotten corrupted. Check for syntax errors in both.
0 Kudos
City_of_Port_Angeles_GIS
New Contributor III
Robert,
   That was the problem! Thank you very much. The widget works fine now except when I try
to draw a polygon, circle or ellipse. I then get an error message from flash. I noticed that the units
drop down for distance is populated (meters, feet, etc.) but the one for area is empty. This is the
error message I get:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.eDraw::DrawWidget/arealengthsCompleteHandler()
at widgets.eDraw::DrawWidget/__geometryService_areasAndLengthsComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.esri.ags.tasks:GeometryService/areasAndLengths/com.esri.ags.tasks:handleAreaLengths()
at Function/http://adobe.com/AS3/2006/builtin::call()
at com.esri.ags.tasks::BaseTask/handleResult()
at com.esri.ags.tasks:BaseTask/protected:sendURLVariables/com.esri.ags.tasks:result()
at mx.rpc::Responder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

I've checked the DrawWidget.xml and I don't see anything wrong. No missing carets, no misspelling, etc. The polygon gets drawn, but the area does not display.
Bill
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bill,

    Copy all of this replacing everything in your DrawWidget.xml

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright © 2008 - 2009 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
 <geometryservice>http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>
 <spatialref>102003</spatialref>
 <distanceunits>
  <distanceunit abbr="m" conversion="1">Meters</distanceunit>
  <distanceunit abbr="km" conversion=".001">Kilometers</distanceunit>
  <distanceunit abbr="ft" conversion="3.2808">Feet</distanceunit>
  <distanceunit abbr="mi" conversion="0.000621">Miles</distanceunit>
 </distanceunits>
 <areaunits>
  <areaunit abbr="sq m" conversion="1">Square Meters</areaunit>
  <areaunit abbr="sq km" conversion="0.000001">Square Kilometers</areaunit>
  <areaunit abbr="sq ft" conversion="10.763910417">Square Feet</areaunit>
  <areaunit abbr="sq mi" conversion="0.0000003861021">Square Miles</areaunit>
  <areaunit abbr="ac" conversion="0.00024710538147">Acres</areaunit>
  <areaunit abbr="ha" conversion="0.0001">Hectares</areaunit>
 </areaunits>
</configuration>
0 Kudos
City_of_Port_Angeles_GIS
New Contributor III
Robert,
   Thanks a lot for taking the time to answer. I'm sure the demands on your time are pressing if they're anything like what I have to deal with here.
   I pasted in your code but I still get the same error message when I try to draw anything that has an area. The drop down menu for area units is still empty. I tried the Adobe help for Flash 4, but couldn't
seem to find anything that pertained to my problem. If I could just figure out why the drop down menu isn't being populated, I think I might be able to resolve this. So far no luck. Any more ideas
would be greatly appreciated.
   Also, does ESRI have an MVP for this forum and if so how do I vote?
Bill
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bill,

  This is very strange. Are you using the compiled or uncompiled?
0 Kudos
City_of_Port_Angeles_GIS
New Contributor III
Robert,
   I am using the uncompiled version.
Bill
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bill,

   I don't really have a clue why you are running into this issue. Can you download it again and replace everything?
0 Kudos
City_of_Port_Angeles_GIS
New Contributor III
Robert,
   That was the answer! Works like a charm and NO ERROR MESSAGES! Beautiful widget Robert,
keep up the good work and thanks again for all your help.
Bill
0 Kudos
KwokKin_Wai
New Contributor
Dear Robert,
          The enhanced Draw Widget work fine, however, when I use the mouse and click on the polygon that I drawn, right click the mouse, apart from the "Clear Feature" options, there are two other options below. when I select these two options, the function displayed a lot of red outline rectanlge and gone mad....how can I disable these two options if I don't need them?

Thank you for your help and look forward to your reply

John
0 Kudos