Enhanced Draw Widget Functionality

5713
33
Jump to solution
02-01-2013 05:15 AM
JustinFultz
New Contributor III
Robert,

I was curious if you had any plans to incorporate the real time measurment functionality that is in the standard draw widget at 3.1 into your enhanced widget. I prefer your enhanced version, and it will continue to be my go to draw widget, but would love to see the real time functionality in the future if possible.

Thanks for all of the work you put into these widgets! They are great!

Justin
Tags (2)
33 Replies
RobertScheitlin__GISP
MVP Emeritus
Justin,

   Yep that would be an issue.
0 Kudos
ScottMcGee
Occasional Contributor
I'm using Robert's Enhanced Draw widget and all's well with it, except for a few small issues:

1) It's difficult or impossible select text that is added to the map. I can click on and select a text string immediately after adding it, but if I then add another text string or shape (marker, line, circle, rectangle, polygon, etc.) then I can no longer select any text that's been placed. So if I need to move a piece of text, the only thing I can do is to clear all text and shapes that have been placed and start from scratch, trying to make sure that the text is placed exactly where it needs to be (and this can often be a trial-and-error affair).

I thought it might be something about my Flex app, but I tried Robert's eDraw demo page ( http://gis.calhouncounty.org/FlexViewer3.3/index.html?config=config-eDraw.xml&draw=http://gis.calhou... ) and it has the same text selection issue. I experience this problem in the newest versions of Internet Explorer, Chrome, and Firefox. Does anyone else have this issue as well?

2) In the Show Measurements area, the Bold and Underline buttons don't have the B and U text on them - they are blank, but they do function properly. See the screenshot below. Any idea why the B and U don't show up? Also, instead of the Distance Units label, the widget shows Distance U...   . I made a copy of Robert's default eDrawWidget.xml file and edited it by changing the order in which the distance and area units are displayed in the drop-down pick lists, and I also added the coordinate system we commonly use to the <pointunits> tag. I thought that maybe these customizations might be causing the issues, so I then switched to Robert's default unedited XML that comes with the widget, and I have the same issues.

EDIT: I fixed issue #2 (blue text above). I had my app configured to use the Verdana font for all the widgets. I switched it to Arial and it fixed the display issue in Robert's eDraw widget and a couple of other widgets that had display issues.



I'm using version 3.3.1 (dated 5/16/2013) of the widget with Flex 3.3.

[ATTACH=CONFIG]24397[/ATTACH]
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   I am working to find the issue that both the Draw and the eDraw have with this, but in the mean time there is a VERY simple workaround just click on the map (where there is no graphic) before you attempt to click on the text. If you click on a garphic (like a polygon and move it) click on the map before you attempt to select the text by clicking on it.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   If you are using the source code then this is the change that you can make to fix this issue. I will be adding it to the next release.

This code goes in the DrawWidget.mxml and/or the eDrawWidget.mxml

            private function map_mouseUpHandler(event:MouseEvent):void
            {
//My Add
                if(event.target is FTETextField){
                    if(event.target.parent !== editGraphic){
                        map.removeEventListener(MouseEvent.MOUSE_UP, map_mouseUpHandler);
                        map.removeEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler);
                        
                        stopEditing();
                    }else{
                        return;
                    }
                }
//End My Add
                if (event.target !== editGraphic)
                {
                    map.removeEventListener(MouseEvent.MOUSE_UP, map_mouseUpHandler);
                    map.removeEventListener(MouseEvent.MOUSE_MOVE, map_mouseMoveHandler);

                    stopEditing();
                }
            }
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,


   Next version of the eDraw widget is available:

Version 3.3.2 - 5/17/2013
* Fixed an issue where it was extremely difficult to select and move text placed by the widget.
0 Kudos
ScottMcGee
Occasional Contributor
All,


   Next version of the eDraw widget is available:

Version 3.3.2 - 5/17/2013
* Fixed an issue where it was extremely difficult to select and move text placed by the widget.



Robert,

Thank you for the quick update. I installed 3.3.2 and it works perfectly. My map users are going to be very happy now!

I want to publicly thank you for all the great widgets you've built and all the fantastic support you provide on this forum. I'm using six of your widgets in our mapper, and it is a much better product because of your efforts. For your viewing pleasure, I've attached screenshots of your Enhanced Splash widget in action!

ESRI, if you're reading this, you need to make Robert an offer he can't refuse!


[ATTACH=CONFIG]24452[/ATTACH]  [ATTACH=CONFIG]24453[/ATTACH]  [ATTACH=CONFIG]24454[/ATTACH]  [ATTACH=CONFIG]24455[/ATTACH]
0 Kudos
JosVroegop
New Contributor II
Hello Robert,

Thank you for a great widget, your work is greatly appreceated!

I have a question about the 3.3.2 version of the widget. The tooltips don't seem to show when drawing on the map (click to start drawing, double click to finish)

Is this something that could be modified? We are working with the sourcecode. Thanks in advance.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jos,

   I should make them configurable. I personally don't like the tooltips so I removed them.

Here is the code block to change:

                switch (drawType)
                {
                    case DrawTool.MAPPOINT:
                    {
                        drawingPolygon = drawingLine = false;
                        addingText = selectedDrawingIcon.id == "text";
                        drawingPoint = !addingText;
                        showMeasurements = drawingPoint = !addingText;
                        PointXY = true;
                        drawMode = addingText ? TEXT_MODE : null;
                        drawStatus = (drawMode == TEXT_MODE) ? addTextLabel : drawPointLabel;
                        setMapAction(drawType, drawStatus, null, map_drawEndHandler);
                        break;
                    }
                    case DrawTool.POLYLINE:
                    {
                        drawingPoint = addingText = drawingPolygon = PointXY = false;
                        drawingLine = showMeasurements = true;
                        drawStatus = drawLineLabel;
                        setMapAction(drawType, drawStatus, lineSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.FREEHAND_POLYLINE:
                    {
                        drawingPoint = addingText = drawingPolygon = PointXY = false;
                        drawingLine = showMeasurements = true;
                        drawStatus = drawFreehandLineLabel;
                        setMapAction(drawType, drawStatus, lineSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.EXTENT:
                    {
                        addingText = drawingPoint = drawingLine = PointXY = false;
                        drawingPolygon = showMeasurements = true;
                        drawStatus = drawRectangleLabel;
                        setMapAction(drawType, drawStatus, fillSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.CIRCLE:
                    {
                        addingText = drawingPoint = drawingLine = PointXY = false;
                        drawingPolygon = showMeasurements = true;
                        drawStatus = drawCircleLabel;
                        setMapAction(drawType, drawStatus, fillSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.ELLIPSE:
                    {
                        addingText = drawingPoint = drawingLine = PointXY = false;
                        drawingPolygon = showMeasurements = true;
                        drawStatus = drawEllipseLabel;
                        setMapAction(drawType, drawStatus, fillSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.POLYGON:
                    {
                        addingText = drawingPoint = drawingLine = PointXY = false;
                        drawingPolygon = showMeasurements = true;
                        drawStatus = drawPolygonLabel;
                        setMapAction(drawType, drawStatus, fillSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                    case DrawTool.FREEHAND_POLYGON:
                    {
                        addingText = drawingPoint = drawingLine = PointXY = false;
                        drawingPolygon = showMeasurements = true;
                        drawStatus = drawFreehandPolygonLabel;
                        setMapAction(drawType, drawStatus, fillSymbol, map_drawEndHandler, map_drawUpdateHandler, false, false);
                        break;
                    }
                }
0 Kudos
JosVroegop
New Contributor II
Robert,

Thanks for the swift reply, that did it 🙂
0 Kudos
AaronKreag
Occasional Contributor
Robert,

Is there a way to set:

default show measurements to true

default distance units to feet

default area units to acre

I have been looking and can not find anything.  I am using Flex Viewer 3.6, exported and now working in the configs to adjust stuff.

Thank you! Aaron
0 Kudos