Hello Harpreet,
I've implemented support for dragging symbols (which are OMGraphics)
around the map by having a custom mouse mode and a custom layer to handle
and manage the symbols.
The layer is sent the mouse events by the mouse mode. The layer picks up
the mousePressed event and sees if there is a symbol within range of the
event (normally 10 pixels). If there is it sets a flag to say that a drag
is about to start. mouseDragged events are then used to draw a marquee
rectangle on the map. This was a little tricky as the marquee is drawn at
the size of the image rectangle on the map but the original mousePressed
event is (probably) at some offset from the centre of the symbol. The
mousePressed event handler calculates and remembers this offset. The
mouseDragged events draw the marquee at this offset from the mouseDragged
event position.
The mouseReleased event applies the same offset and calculates the new
position for the symbol. This is set into the position for the OMGraphic
and the layers is regenerated.
For performance reasons I chose to draw the marquee during a drag rather
than redrawing the OMGraphic symbol each time. The marquee is draw using
the standard XOR technique. You could redraw the OMGraphic at the mouse
position on each mouseDragged event if you wished.
Hope that helps. Happy New Year.
Adrian
_____________________________________________
Dr. Adrian Lumsden
Product Specialist
Scientific Software and Systems Limited
Tel: +64 4 917-6680 (direct)
+64 4 917-6670 (reception)
Fax: +64 4 917-6671
E-mail: Adrian.Lumsden@spamtrap.sss.co.nz
Visit us on the Web at: http://www.sss.co.nz
_____________________________________________
This e-mail passed SSS's content security scan.
It is covered by the confidentiality clauses at
http://www.sss.co.nz/content_and_confidentiality
Harpreet <harpreet@logiceastern.com>
Sent by: owner-openmap-users@bbn.com
27/12/03 23:36
To: openmap-users@bbn.com
cc:
Subject: [OpenMap Users] MIME-Version: 1.0
hi there
iam implementing the openmap application by plotting various OMGraphic
items w/o any Drag and Drop support
now i want tht the various graphics tht are have been plotted should
support DND
can anyone pls tell me in brief the various steps tht are involved in the
process
is there any example for tht ????????
pls help
thanxx
Harpreet
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Sun Jan 4 18:51:47 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT