[OpenLayers-Users] It is possible to give priority to controls??
Eric Lemoine
eric.lemoine at camptocamp.com
Sun Apr 18 14:31:18 EDT 2010
On Sunday, April 18, 2010, fedesan <fedesanchez888 at gmail.com> wrote:
>
> Hi list,
>
> I'm having problems with this issue:
>
> I have two OpenLayers.Control.SelectFeature activated.
> The first one is for drawing a box and the second one only allows hovering
> so i can show/hide a pop-up
> when i put the mouse over the features selected with the first control.
>
> Everything works fine until here, but mi problem occurs when i try to make a
> new selection: If i draw a box on an area where there are selected features
> from the the previous selection mi box gets destroyed by the creation of a
> pop-up.
> If i draw the box really quickly the pop-ups dont have enought time to show
> up , but that is not what i'm loocking for.
>
> So i was wondering if there is a way to no show pop-ups when i'm drawing a
> box.
>
> This is some of the code:
>
> selectCtrl = new OpenLayers.Control.SelectFeature(layer,
> {box:true, clickout:true,toggle:true,onSelect:
> function(){hover.activate();},onUnselect: function(){hover.deactivate();}
> });
> map.addControl(selectCtrl);
> selectCtrl.activate();
>
> hover = new OpenLayers.Control.SelectFeature(layer,{hover:true});
> map.addControl(hover);
> hover.events.register("featurehighlighted", this, function(e)
> {createPopup(e.feature)});
> hover.events.register("featureunhighlighted", this, function(e) {
> popup.close();
> });
I'm not sure I understand your problem. Have you tried
highlightOnly:true in the options of the hover control?
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list