[OpenLayers-Users] FW: Multiple Vector Layers (FireFox issue)

Andreas Hocevar ahocevar at opengeo.org
Wed Apr 14 07:48:05 EDT 2010


If you think that this is a regression that should be fixed, please create a stripped down example to show the issue. Without that, we cannot do further investigation.

Thanks,
Andreas.

On Apr 14, 2010, at 13:28 , Jordi Romagos i Figueras wrote:

> I promise the data is always the same. The only thing I change is the version, in fact, when I select the feature I can see the original information position (lon and lat), not the moved. And the rare thing is what you said, Andreas, is only a few positions who doesn't match.  I forgot to see it happens only in FF 3.6.3 not in IE8.
>  
> And now I was playing with data, and when I change the original zoom the positions appears in the same position around the map, not transformed:
>  
> http://img706.imageshack.us/img706/7226/differentzoom.png
> http://img594.imageshack.us/img594/9069/originalzoom.png
> 
>  
>  
> > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)
> > From: ahocevar at opengeo.org
> > Date: Wed, 14 Apr 2010 12:42:12 +0200
> > CC: users at openlayers.org
> > To: jordi_romagos at hotmail.com
> > 
> > Hi,
> > 
> > On Apr 14, 2010, at 10:41 , Jordi Romagos i Figueras wrote:
> > 
> > > Here are two images, one with OL 2.8 and other with OL 2.9 RC2 (I only changed include openlayers script line)
> > > 
> > > http://img27.yfrog.com/gal.php?g=withol28.png
> > 
> > Are you sure that your data has not changed between the two screenshots? I have opened both screenshots next to each other, and most of the positions match. The ones that don't seem to have been removed/added.
> > 
> > -Andreas.
> > 
> > > 
> > > 
> > > I'm so sorry Bart, it's impossible to show the code.
> > > 
> > > I can show how I add positions: I get positions from php file with utm format and then I add in a vector. The code is something like that:
> > > 
> > > var positions= [];
> > > 
> > > for (var j=0 ;j<dades_posicions.length;j++){
> > > position = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point( dades_posicions[j][idx_lon],dades_posicions[j][idx_lat]), {velo: dades_posicions[j][idx_vel],rotation:direccio*45,figura:direccio==0?"circle":"triangle"});
> > > positions.push(position);
> > > }
> > > 
> > > layerPositions.addFeatures(positions);
> > > 
> > > 
> > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)
> > > From: bartvde at osgis.nl
> > > Date: Wed, 14 Apr 2010 09:56:32 +0200
> > > CC: users at openlayers.org
> > > To: jordi_romagos at hotmail.com
> > > 
> > > Hi,
> > > 
> > > wrt your OL 2.9RC2 remark, dus you have an example page to demonstrate the problem?
> > > 
> > > Best regards,
> > > Bart
> > > 
> > > On Apr 14, 2010, at 9:52 AM, Jordi Romagos i Figueras wrote:
> > > 
> > > 
> > > Finally I found an explanation!!! 
> > > 
> > > 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! 
> > > About event handlers I also tried before but I had the same problem, in FF in some layers doesn't works mouse events. 
> > > 
> > > 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?
> > > 
> > > Another time a lot of thanks!
> > > 
> > > 
> > > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)
> > > > From: ahocevar at opengeo.org
> > > > Date: Tue, 13 Apr 2010 16:25:10 +0200
> > > > CC: users at openlayers.org
> > > > To: jordi_romagos at hotmail.com
> > > > 
> > > > 
> > > > On Apr 13, 2010, at 15:35 , Jordi Romagos i Figueras wrote:
> > > > 
> > > > > Sorry Andreas,
> > > > > 
> > > > > I will explain better,
> > > > > 
> > > > > 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:
> > > > > 
> > > > > selectControl = new OpenLayers.Control.SelectFeature(layer1, {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});
> > > > 
> > > > Note: there is no hover method. hover is a boolean property. Also, you should consider using event handlers instead of callback functions.
> > > > 
> > > > > 
> > > > > 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:
> > > > > 
> > > > > selectControl = new OpenLayers.Control.SelectFeature([layer1], {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});
> > > > 
> > > > Are you sure you are using OpenLayers >= 2.8? Multi-layer selection was added in 2.8
> > > > 
> > > > Regards,
> > > > Andreas.
> > > > 
> > > > 
> > > > > 
> > > > > All of this happend when I'm using Firefox browser.
> > > > > 
> > > > > Thanks another time,
> > > > > Jordi.
> > > > > 
> > > > > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)
> > > > > > From: ahocevar at opengeo.org
> > > > > > Date: Tue, 13 Apr 2010 14:30:29 +0200
> > > > > > CC: users at openlayers.org
> > > > > > To: jordi_romagos at hotmail.com
> > > > > > 
> > > > > > On Apr 13, 2010, at 12:58 , Jordi Romagos i Figueras wrote: 
> > > > > > > I tried what you said Andreas, and doesn't work for me (I'm using OL 2.8)
> > > > > > 
> > > > > > What exactly "does not work"?
> > > > > > 
> > > > > > > I changed:
> > > > > > > 
> > > > > > > selectControl = new OpenLayers.Control.SelectFeature(layer1, {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});
> > > > > > > for:
> > > > > > > selectControl = new OpenLayers.Control.SelectFeature([layer1,layer2], {onSelect: onFeatureSelect,onUnselect:onFeatureUnSelect, hover: onFeatureHover});
> > > > > > > 
> > > > > > > I have to do something else?
> > > > > > 
> > > > > > No, that should be all.
> > > > > > 
> > > > > > Regards,
> > > > > > Andreas.
> > > > > > 
> > > > > > > 
> > > > > > > Thanks.
> > > > > > > 
> > > > > > > 
> > > > > > > > Date: Mon, 12 Apr 2010 20:52:50 +0200
> > > > > > > > From: ahocevar at opengeo.org
> > > > > > > > To: users at openlayers.org
> > > > > > > > Subject: Re: [OpenLayers-Users] Multiple Vector Layers (FireFox issue)
> > > > > > > > 
> > > > > > > > On 2010-04-12 20:30 , chandanpansare wrote:
> > > > > > > > > I have multiple vector layers added in map and for each layer I have
> > > > > > > > > SelectFeature control.
> > > > > > > > > In IE, Chrome and Safari I'm able to select features of all the layers but
> > > > > > > > > in case of FireFox only features from the last layer added are accessible.
> > > > > > > > > would like to if there any work around / solution for this or is it a known
> > > > > > > > > issue?
> > > > > > > > > Any help will be greatly appreciated.
> > > > > > > > > 
> > > > > > > > 
> > > > > > > > You only need one SelectFeature control for all your layers. Configure 
> > > > > > > > it with an array of your layers, instead of just one layer.
> > > > > > > > 
> > > > > > > > Regards,
> > > > > > > > Andreas.
> > > > > > > > 
> > > > > > > > -- 
> > > > > > > > Andreas Hocevar
> > > > > > > > OpenGeo - http://opengeo.org/
> > > > > > > > Expert service straight from the developers.
> > > > > > > > 
> > > > > > > > _______________________________________________
> > > > > > > > Users mailing list
> > > > > > > > Users at openlayers.org
> > > > > > > > http://openlayers.org/mailman/listinfo/users
> > > > > > > 
> > > > > > > Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis!_______________________________________________
> > > > > > > Users mailing list
> > > > > > > Users at openlayers.org
> > > > > > > http://openlayers.org/mailman/listinfo/users
> > > > > > 
> > > > > > -- 
> > > > > > Andreas Hocevar
> > > > > > OpenGeo - http://opengeo.org/
> > > > > > Expert service straight from the developers.
> > > > > > 
> > > > > 
> > > > > Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis!_______________________________________________
> > > > > Users mailing list
> > > > > Users at openlayers.org
> > > > > http://openlayers.org/mailman/listinfo/users
> > > > 
> > > > -- 
> > > > Andreas Hocevar
> > > > OpenGeo - http://opengeo.org/
> > > > Expert service straight from the developers.
> > > > 
> > > 
> > > Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis! _______________________________________________
> > > Users mailing list
> > > Users at openlayers.org
> > > http://openlayers.org/mailman/listinfo/users
> > > 
> > > 
> > > " ¿Sabes cómo tener tus amigos de Facebook en Messenger?" Entra aquí_______________________________________________
> > > Users mailing list
> > > Users at openlayers.org
> > > http://openlayers.org/mailman/listinfo/users
> > 
> > 
> > 
> > -- 
> > Andreas Hocevar
> > OpenGeo - http://opengeo.org/
> > Expert service straight from the developers.
> > 
> 
> 
> Tus datos personales, más seguros con Internet Explorer 8. ¡Descárgatelo gratis!_______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list