Re: [OpenMap Users] Creating a Legend Minimizer

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Fri, 18 Jun 2010 10:54:46 -0400

Hi John,

If your layer extends OMGraphicHandlerLayer with a StandardMapMouseInterpreter for its MapMouseListener (the standard setup), the interpreter will call isSelectable(OMGraphic) when an object is clicked. You can reply true if the object provided is your minus sign, and then select(OMGraphicList) will be called with that graphic on the list. You can respond by setting the legend to be not visible, and by probably setting the graphic image to a plus sign.

The interpreter can provide all of the mouse mode ids (you can set that in the properties or programmatically) so it will receive events from all mouse modes (selectMouseModeIDsForEvents(String[])).

Hope this helps,

Don


On Jun 18, 2010, at 9:33 AM, John McMahon wrote:

> Hi All,
>
> I have a legend in my MapBean, that is just a layer in a fixed position. I would like to add a “Quick Hide” feature that would add a clickable minus sign in the upper right corner of that LegendLayer.
>
> Has anyone done this before? Would it be difficult to do?
>
> Currently, my LegendLayer just extends Layer and uses OMGraphics and OMText to construct a map legend. I added the minus sign graphic, but how do I check that it was clicked? I already have several mouse modes configured, and it would need to be clickable from any of those modes.
>
> Any suggestion on how to go about doing this?
>
> Thanks,
>
> John
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Jun 18 2010 - 10:55:23 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT