[OpenLayers-Users] Register multiple map layers for same event... how???

plen peteralen at earthlink.net
Wed Oct 28 15:38:06 EDT 2009


Eric,

Thanks for the response.  You have answered some of my questions in the past
and I appreciate it.  As for this question, I did find the SelectFeature
control you mentioned and was able to successfully add more than one
OpenLayers.Layer.Vector layer to the control and was able to register a
"featureselected" event via:

getFeaturesLayer1().events.register("featureselected", getFeaturesLayer1(),
fclick);

All works fine.  I orginally thought, however, that my real problem would be
solved in finding this solution, but it is not.  What I really need is to be
able to share events amoung two different types of layers.  For example, I
need to have an OpenLayers.Layer.Vector and an OpenLayers.Layer.Markers
share the same event (rather than two OpenLayers.Layer.Vector share the same
event).  Looking at the API for the SelectFeature control, it seems to
indicate that only OpenLayers.Layer.Vector layers can be used.  Is this true
or is there a way to have two different types of layers share the same
event?

Thanks again for any insight - Peter





Eric Lemoine-2-2 wrote:
> 
> On Thursday, October 22, 2009, plen <peteralen at earthlink.net> wrote:
>>
>> Hello,
>>
>> OpenLayers v2.7 or v2.8 added the capability that would allow multiple
>> map
>> layers to listen for the same event, such as a mouseclick or mouseover.
>>  I
>> cannot find an example of how this is done.  Does anyone know?
> 
> the SelectFeature control can now be configured with multiple layers.
> Search for "SelectFeature" in the examples.
> 
> Cheers,
> 
> -- 
> 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
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Register-multiple-map-layers-for-same-event-how-tp3872249p3907727.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list