<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<BR>Finally I found an explanation!!! <BR>
<BR>
The problem was because I put selectfeature control code above to map.addLayers code. If I put the code below map.addLayers it works fine! <BR>
About event handlers I also tried before but I had the same problem, in FF in some layers doesn't works mouse events. <BR>
<BR>
Another thing, I'm not sure If it's a problem because I not read 2.9 API. I tried the same code using OL 2.9 RC2 and positions doesn't match! I don't know If I have to change anything?<BR>
<BR>
Another time a lot of thanks!<BR>
<BR>
<BR>> Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)<BR>> From: ahocevar@opengeo.org<BR>> Date: Tue, 13 Apr 2010 16:25:10 +0200<BR>> CC: users@openlayers.org<BR>> To: jordi_romagos@hotmail.com<BR>> <BR>> <BR>> On Apr 13, 2010, at 15:35 , Jordi Romagos i Figueras wrote:<BR>> <BR>> > Sorry Andreas,<BR>> > <BR>> > I will explain better,<BR>> > <BR>> > What I want is when some user select one feature of the two top layers the application displays a popup with information extracted from a php script. This, works fine when I do this:<BR>> > <BR>> > selectControl = new OpenLayers.Control.SelectFeature(layer1, {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});<BR>> <BR>> Note: there is no hover method. hover is a boolean property. Also, you should consider using event handlers instead of callback functions.<BR>> <BR>> > <BR>> > But it doesn't call my onFeatureSelect method when I call like an array parameter, in fact, now I prove only one and the same layer and it doesn't works:<BR>> > <BR>> > selectControl = new OpenLayers.Control.SelectFeature([layer1], {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});<BR>> <BR>> Are you sure you are using OpenLayers >= 2.8? Multi-layer selection was added in 2.8<BR>> <BR>> Regards,<BR>> Andreas.<BR>> <BR>> <BR>> > <BR>> > All of this happend when I'm using Firefox browser.<BR>> > <BR>> > Thanks another time,<BR>> > Jordi.<BR>> > <BR>> > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)<BR>> > > From: ahocevar@opengeo.org<BR>> > > Date: Tue, 13 Apr 2010 14:30:29 +0200<BR>> > > CC: users@openlayers.org<BR>> > > To: jordi_romagos@hotmail.com<BR>> > > <BR>> > > On Apr 13, 2010, at 12:58 , Jordi Romagos i Figueras wrote: <BR>> > > > I tried what you said Andreas, and doesn't work for me (I'm using OL 2.8)<BR>> > > <BR>> > > What exactly "does not work"?<BR>> > > <BR>> > > > I changed:<BR>> > > > <BR>> > > > selectControl = new OpenLayers.Control.SelectFeature(layer1, {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});<BR>> > > > for:<BR>> > > > selectControl = new OpenLayers.Control.SelectFeature([layer1,layer2], {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});<BR>> > > > <BR>> > > > I have to do something else?<BR>> > > <BR>> > > No, that should be all.<BR>> > > <BR>> > > Regards,<BR>> > > Andreas.<BR>> > > <BR>> > > > <BR>> > > > Thanks.<BR>> > > > <BR>> > > > <BR>> > > > > Date: Mon, 12 Apr 2010 20:52:50 +0200<BR>> > > > > From: ahocevar@opengeo.org<BR>> > > > > To: users@openlayers.org<BR>> > > > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)<BR>> > > > > <BR>> > > > > On 2010-04-12 20:30 , chandanpansare wrote:<BR>> > > > > > I have multiple vector layers added in map and for each layer I have<BR>> > > > > > SelectFeature control.<BR>> > > > > > In IE, Chrome and Safari I'm able to select features of all the layers but<BR>> > > > > > in case of FireFox only features from the last layer added are accessible.<BR>> > > > > > would like to if there any work around / solution for this or is it a known<BR>> > > > > > issue?<BR>> > > > > > Any help will be greatly appreciated.<BR>> > > > > > <BR>> > > > > <BR>> > > > > You only need one SelectFeature control for all your layers. Configure <BR>> > > > > it with an array of your layers, instead of just one layer.<BR>> > > > > <BR>> > > > > Regards,<BR>> > > > > Andreas.<BR>> > > > > <BR>> > > > > -- <BR>> > > > > Andreas Hocevar<BR>> > > > > OpenGeo - http://opengeo.org/<BR>> > > > > Expert service straight from the developers.<BR>> > > > > <BR>> > > > > _______________________________________________<BR>> > > > > Users mailing list<BR>> > > > > Users@openlayers.org<BR>> > > > > http://openlayers.org/mailman/listinfo/users<BR>> > > > <BR>> > > > Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis!_______________________________________________<BR>> > > > Users mailing list<BR>> > > > Users@openlayers.org<BR>> > > > http://openlayers.org/mailman/listinfo/users<BR>> > > <BR>> > > -- <BR>> > > Andreas Hocevar<BR>> > > OpenGeo - http://opengeo.org/<BR>> > > Expert service straight from the developers.<BR>> > > <BR>> > <BR>> > Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis!_______________________________________________<BR>> > Users mailing list<BR>> > Users@openlayers.org<BR>> > http://openlayers.org/mailman/listinfo/users<BR>> <BR>> -- <BR>> Andreas Hocevar<BR>> OpenGeo - http://opengeo.org/<BR>> Expert service straight from the developers.<BR>> <BR>                                            <br /><hr />Tus datos personales, más seguros con Internet Explorer 8. <a href='http://www.microsoft.com/spain/windows/internet-explorer/default.aspx' target='_new'>¡Descárgatelo gratis!</a></body>
</html>