[OpenMap Users] RE: remove a layer (via MapBean)

From: Ben Podoll <benjamin.podoll_at_und.edu>
Date: Mon, 2 Aug 2004 21:47:54 -0500

The below code prints out all the layers I have in my openmap.properties
file, why? I am trying to deduce what layers are on and what layers are off.
If they are all in the layerHandler then why doesn't a call to
setVisible(true) turn them on? What step am I missing?

LayerHandler layerHandler =
(LayerHandler)gisp.basicMapPanel.getMapComponent("layerHandler");

         Layer[] layers = layerHandler.getLayers();
         for(int i=0; i<layers.length; i++){
            Layer tempLayer = (Layer)layers[i];
            if(layerHandler.hasLayer(tempLayer)){
               System.out.println(tempLayer);
            }
         }

So basically my question is, if I have the BasicMapPanel what are the steps
needed to get a layer on and off?

> -----Original Message-----
> From: OpenMap Support [mailto:openmap_at_bbn.com]
> Sent: Monday, August 02, 2004 8:22 PM
> To: Ben Podoll
> Cc: openmap-users_at_bbn.com
> Subject: Re: remove a layer (via MapBean)
>
> Tell the LayerHandler, not the MapBean.
>
> - Don
>
> On Aug 2, 2004, at 7:45 PM, Ben Podoll wrote:
>
> > I have a BasicMapPanel and I have my openmap.properties file display
> > states,
> > counties and river.
> >
> > Now that the application is up and running I want to use a custom
> > button to
> > turn on/off layers.
> >
> > The MapBean javadocs make it sound like I can turn on/off a layer via
> > it's
> > methods. They say to use the remove() and add() methods...
> >
> > But I don't see how I can get at the layers?
> > basicMapPanel.getMapBean().remove(0);
> >
> > I was hoping there was a method like:
> > basicMapPanel.getMapBean().removeLayer("us_counties");
> >
> > Or better yet:
> > basicMapPanel.getMapBean().getLayer("us_counties").setVisible(false);
> >
> > Is there something like this at my finger tips since I can get at the
> > MapBean?
> >
> > ~Ben
> >
> >
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Don Dietrick, dietrick_at_bbn.com
> BBN Technologies, Cambridge, MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



--
[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 Mon Aug 02 2004 - 22:48:46 EDT

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