Hi Karl,
OMGraphics have (and had) a distance(x, y) method, where x, y are the
MouseEvent coordinates. If the distance is 0, the coordinates are
touching the OMGraphic on the screen.
OMGraphicList has a findClosest(x, y) method that returns an OMGraphic
touched by the x, y screen coordinate.
Your layer would implement MapMouseListener to receive MouseEvents,
which you would pass to these methods and react accordingly.
- Don
On Mar 31, 2004, at 1:02 PM, Karl Koch wrote:
> Hello group,
>
> can somebody point to an example code how ot implement the following:
>
> I have a layer, which inherits from Layer and uses some OMGraphic
> objects
> drawn to that layer. I want to allow these points to be clickedable
> and trigger
> some code based on that. It should be fast and simple AND most
> importantly
> it sould not rely on any OpenMap code later than version 3.7. This
> includes
> not using OMGraphicsHandlerLayer for example :-)
>
> I guess I will need a kind of mouseListener implementation. However,
> the
> problem after getting the mouseposition is generally to decide if the
> point was
> touched by the click or not. This depends on the projection which for
> example changes after every zoom or panning of the map (mouseposition
> are screen
> coorrdinates!).
>
> Does OpenMap provide an easy way allowing to identify if a OMGraphic
> object
> was clicked? Has somebody done exactly this and could provide the code
> to
> allow me a look?
>
> Also...
>
> Is there a codebase or does somebody know webpages / blogs etc. which
> have
> more code examples for common OpenMap implementation problems? Would
> be good
> fro beginners to get easier in using the API...
>
> Kind Regards,
> Karl
>
> --
> +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter
> Virenschutz +++
> 100% Virenerkennung nach Wildlist. Infos:
> http://www.gmx.net/virenschutz
>
> --
> [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"]
>
-- [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 Wed Mar 31 17:31:36 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT