Multiple LocationLayers with Popup Menus

View: New views
6 Messages — Rating Filter:   Alert me  

Multiple LocationLayers with Popup Menus

by Lin, Sunny (Shih-Hung) :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I implemented multiple LocationLayers, each with a LocationHandler to allow pup-up menu for more information of Locations in the layer.  They work fine independently until I put them together.  It seems only the top-most enabled layer can get the mouse event.  I have to turn off a top layer in order to get detail information of the layer below.  Would someone please tell me what I have done wrong and how to fix it?

 

Sunny Lin


Re: Multiple LocationLayers with Popup Menus

by William M. Barber :: Rate this Message:

| View Threaded | Show Only this Message

Hi Sunny,

don't know if anyone has responded to this yet.

It sounds as if your top-most layer is consuming the mouse events.
You need to tell either the mouse mode or the mouse listener methods not to
consume events. There is more than one way to do this I think, depending on your
event needs. Look at the mouse*() methods in MapMouseListener, and at
setConsumeEvents() in AbstractMouseMode.

Hope this helps, Bill

On Tue, 30 Jan 2007, Lin, Sunny (Shih-Hung) wrote:

> Hi,
>
>
>
> I implemented multiple LocationLayers, each with a LocationHandler to
> allow pup-up menu for more information of Locations in the layer.  They
> work fine independently until I put them together.  It seems only the
> top-most enabled layer can get the mouse event.  I have to turn off a
> top layer in order to get detail information of the layer below.  Would
> someone please tell me what I have done wrong and how to fix it?
>
>
>
> Sunny Lin
>
>

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Parent Message unknown RE: Multiple LocationLayers with Popup Menus

by Lin, Sunny (Shih-Hung) :: Rate this Message:

| View Threaded | Show Only this Message

Hi, William,

Thank you for your response.  I found a way although not a desired one.
I chain these layers from top to bottom, with each layer knows the next
layer below.  I override "findClosestLocation" as following.  In this
way, an upper layer will get the priority.

LocationLayer nextLayer;
public Location findClosestLocation(MouseEvent e) {
  if ( ! isVisible()) {
    if (nextLayer == null)
      return null;
    else
      return nextLayer.findClosestLocation(e);
  }
  Location loc = super.findClosestLocation(e);
  if (loc == null) {
    if (nextLayer != null && nextLayer.isVisible())
      loc = nextLayer.findClosestLocation(e);
  }
  return loc;
}

-Sunny Lin

-----Original Message-----
From: William M. Barber [mailto:wbarber@...]
Sent: Thursday, February 01, 2007 3:09 PM
To: Lin, Sunny (Shih-Hung)
Cc: OpenMap MList
Subject: Re: [OpenMap Users] Multiple LocationLayers with Popup Menus

Hi Sunny,

don't know if anyone has responded to this yet.

It sounds as if your top-most layer is consuming the mouse events.
You need to tell either the mouse mode or the mouse listener methods not
to
consume events. There is more than one way to do this I think, depending
on your
event needs. Look at the mouse*() methods in MapMouseListener, and at
setConsumeEvents() in AbstractMouseMode.

Hope this helps, Bill

On Tue, 30 Jan 2007, Lin, Sunny (Shih-Hung) wrote:

> Hi,
>
>
>
> I implemented multiple LocationLayers, each with a LocationHandler to
> allow pup-up menu for more information of Locations in the layer.
They
> work fine independently until I put them together.  It seems only the
> top-most enabled layer can get the mouse event.  I have to turn off a
> top layer in order to get detail information of the layer below.
Would
> someone please tell me what I have done wrong and how to fix it?
>
>
>
> Sunny Lin
>
>

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Displaying images

by Lepkowski, Thomas :: Rate this Message:

| View Threaded | Show Only this Message

Hello,

Given a LatLonBox and a png file, is it possible to have the png file
placed on the map, stretched or reduced to fit the LotLonBox?  Kind of
like an overlay in Google Earth.

Would appreciate any info or success stories about this.

Thanks
-Tom

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Re: Displaying images

by Don Dietrick :: Rate this Message:

| View Threaded | Show Only this Message

Hi Tom,

You can use an OMScalingRaster to hold the PNG this way, and it will  
manage the appearance of the image according to the coordinates you  
provide it.

If you just want to toss the image on the map, you can use the  
CSVTiledImagePlugIn - check the JavaDocs for setup configuration.

Regards,

Don


On Feb 20, 2007, at 5:15 PM, Lepkowski, Thomas wrote:

> Hello,
>
> Given a LatLonBox and a png file, is it possible to have the png file
> placed on the map, stretched or reduced to fit the LotLonBox?  Kind of
> like an overlay in Google Earth.
>
> Would appreciate any info or success stories about this.
>
> Thanks
> -Tom
>
> --
> [To unsubscribe to this list send an email to "majdart@..."
> with the following text in the BODY of the message "unsubscribe  
> openmap-users"]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick@...
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Drawing Circles and Rectangles

by Lepkowski, Thomas :: Rate this Message:

| View Threaded | Show Only this Message

Hello All,

I'd like to drag a circle or rectangle on the map, but I don't want it
to be drawn on the map, or become part of a layer as a shape.  It should
just exist as a dashed line, for example, for the user's visual
pleasure.  If the user clicks away, the dashed line would disappear.
The DrawingLayer seems to do what I need -and more.

Looking for some advise on how to approach this problem.  I'll start by
looking at the Drawing layer and go from there.  Any advise or success
stories anybody can share?

Thanks.
-Tom

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]