Need to place ???Edit??? box around label.

741
7
02-16-2011 06:48 AM
by Anonymous User
Not applicable
I�??m using this code as a starting point to edit user placed labels.

http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm

The labels are actually points that have a textSymbol as their symbol.  If you look at/run the sample above, the graphics (line, polygon, ect) display an �??edit�?? box around them when they are selected.  You can then pull/push on the box to resize it, move it or rotate it.

My label shows no such box.  I can select the text (if I actually click on a letter in the label, doesn�??t work if I click on ANY blank space within the label) and move it, but I don�??t get the edit box around it.

Is this because it�??s a point feature?  Seems strange, because to select it, I don�??t have to actually pick the location of the point, just the text.

I really need that edit box to highlight it and allow the users to rotate and resize (as I said, I can move it, so it is getting sellected)

Thanks
0 Kudos
7 Replies
MarkHoover
Occasional Contributor II
I have a similar issue.  Point and Text graphics are not eligible to be scaled/rotated, and there is no "highlighting" of any graphic if you only turn on MOVE from the Edit Toolbar.

As a result, though their edit tools have been activated, there is no flag of this to the user.  Of course, this could be worked around, but it seems like a feature that has any edit tool turned on ought to give some visual clue innately, much as polygons/polylines/multipoints already do for tools such as rotate and scale.

Haven't implemented it yet in my own code, but here is one idea for working around this.  Add MouseOver events for the graphics that are eligible to be edited.  Upon mosueover, use the getCurrentState() method of the editorToolbar to determine if the graphic in question has a tool (i.e. MOVE) activated.  Then at that point, you could change the cursor to something that denotes this graphic can be dragged around the map at leisure. (For example, that cursor with the 4 arrows pointing out from center, kinda like a compass).

Hope this helps...it is my hope that this functionality will be fleshed out within the API down the line.
0 Kudos
by Anonymous User
Not applicable
Mark,

Thanks for the response.  I have opened an incident about this.  The tech said she thinks it can be done.  I will post the solution (if they have one) when I get it.

Doug
0 Kudos
by Anonymous User
Not applicable
Mark,

This is the response from ESRI, with a possible work around (I havn't looked at it yet).

*** Do not write below this line ***
Hello Doug,

I have been working on the issue and after further analysis, it appears that the behavior encountered while selecting point graphic/text element while working with the Edit toolbar in AGS JavaScript API, seems to be current behavior-by-design. I have logged an enhancement request with development for further research and clarification. You can reference this bug using #NIM065254 [Enhancement request to display the Edit box while selecting point graphic/Text symbol using the Edit Toolbar. ]
 
Thank you for bringing this issue to our attention. At this point, I would suggest you to please use the above number to track any progression with its status.

I wish I had a better option but currently, I can suggest an alternate workflow mentioned in the following sample code:
http://serverapps.esri.com/javascript_examples/text_symbol_demo/text_symbol_demo.html

Please let me know if you require any further assistance with the issue or have additional questions regarding the problem.

Thank you.

Regards,

Sumedha S.
0 Kudos
MarkHoover
Occasional Contributor II
I figured it was by design.  Just wasn't great design in my opinion.

I implemented the workaround I discussed yesterday and it works pretty well.  Though the graphic may not be giving off a visual cue itself, a simple mouseover tells the user instantly whether a given graphic can be moved at the moment or not.
0 Kudos
by Anonymous User
Not applicable
Thanks, I might try that.

What I have found is that it's very hard to pick up the text, you have to actually click on the letter.  If you click between letters, it does not pick it up, just goes back into pan mode.

What is also a problem, is that you have to click once to select, and then again to start the move.  My users will not get this.  Took me awhile, and I knew what I was looking for.
0 Kudos
MarkHoover
Occasional Contributor II
Yeah, clicking the text is really tricky, haven't worked around yet.  That would take quite a bit of creativity.

I like that you have to click once before you start the move, to avoid accidentally moving a specifically placed graphic when all I wanted to do was pan.  If you don't want that behavior though, couldn't you just give each graphic its own invididual edit toolbar and activate it with the MOVE tool upon creation of the graphic?  Then once they click to actually select a graphic it could turn on the other tools such as ROTATE, SCALE, etc.
0 Kudos
by Anonymous User
Not applicable
The selection of the text being so tricky is the big thing for me.

I really don't know.  And I'm kinda working on a deadline.  As this was going to be just a bonus to our users,  I'll hope that ESRI figures it out and add it in later.
0 Kudos