[OpenLayers-Users] rootContainer and selectFeature on many layers

Simone Gadenz simone.gadenz at jrc.it
Wed May 20 04:06:08 EDT 2009


Thanks, I will give your code a try. Thanks.

S.

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of Kris Geusebroek
Sent: Tuesday, May 19, 2009 10:26 PM
To: Simo D; users at openlayers.org
Subject: Re: [OpenLayers-Users] rootContainer and selectFeature on many
layers

Hi,

I'm using the selectfeature with multiple vectorlayers with wfs protocol
successfully.
Here's my code:

    var hoverOptions = {
        multiple: false, hover: true,
        toggleKey: "ctrlKey", // ctrl key removes from selection
        multipleKey: "shiftKey", // shift key adds to selection
		overFeature: function(feature) {
			if (this.hover &&
(OpenLayers.Util.indexOf(feature.layer.selectedFeatures, feature) ==
-1)) {
				var position =
feature.geometry.getBounds().getCenterLonLat();
				if (this.handlers &&
this.handlers.feature && this.handlers.feature.evt &&
this.handlers.feature.evt.xy) {
					position =
this.handlers.feature.evt.xy;
				}
                showDescription(feature, position, true);
			}
        },
		outFeature: function(feature) {
			if (this.hover) {
				hideDescription(feature, true);
			}
		}
    };
    var descOnHover = new
OpenLayers.Control.SelectFeature([wfsPunten,wfsLijnen,wfsGebieden],
hoverOptions);

	map.addControl(descOnHover);


the showDescription function creates a popup to show some attributes of
the feature to the user

Hope this is of use for u (btw I'm using latests version from trunk)

Cheers Kris
-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of Simo D
Sent: Tuesday, May 19, 2009 4:46 PM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] rootContainer and selectFeature on many
layers


Hi, I have the same problem. I upgraded the SelectFeature and
RootContainer
from the trunk in order to have custom popups on multiple GML layers.
But
unfortunately this trick works only in Safari 4.
It's also interesting for me to find a solution to this issue.

Simone


Simone Gadenz wrote:
> 
> Hello! After one message on the list couple of days ago I tried to use
the
> root container to enable the selectfeature on a set of defined GML
layers.
> Has anybody managed to use the rootContainer that is into the trunk?
> 
> Currently I defined the selectfeature using the following code:
> 
> var ctrl_rootlayer = new
> OpenLayers.Control.SelectFeature([a,b,c],function());
> map.addControl(ctrl_rootlayer);
> ctrl_rootlayer.activate();
> 
> The root layer is empty in the produced container (according to
firebug).
> 
> Cheers
> 
> Simone
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context:
http://n2.nabble.com/Re%3A-Is-it-possible-to-get-openlayers-version-2.8-
-tp2886380p2939981.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list