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

plen peteralen at earthlink.net
Thu Oct 29 09:30:53 EDT 2009


Eric,

No, you did not misunderstand my question.  I just put it in two parts. 
Thanks for your latest response.  It verifies one of our main issues.  

On a side note, we did make the switch from creating OpenLayers.Marker
markers (OpenLayers.Layer.Markers layer) to creating
OpenLayers.Feature.Vector features (OpenLayers.Layer.Vector layer) as you
indicated, but what we have found out is that adding the
OpenLayers.Feature.Vector features to the map is a MUCH more expensive
(timewise) operation than adding OpenLayers.Marker markers to the map. 
Because of this, we want to go back to creating OpenLayers.Marker markers
because performance is so much better.

Thanks again for your help Eric - Peter


Eric Lemoine-2-2 wrote:
> 
> On Wednesday, October 28, 2009, plen <peteralen at earthlink.net> wrote:
>>
>> 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?
> 
> the select feature control works with vector layers only. Anyway, it
> is now recommended to use Layer.Vector for markers as well, through
> the externalGraphic style property.
> 
> Sorry if I misunderstood your question.
> 
> -- 
> 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-tp3872249p3912374.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list