[MapQuery] getLayerByOpenLayersId?

Steven M. Ottens steven at minst.net
Thu Jun 23 05:23:20 EDT 2011


  I've introduced two new events bound to the Map object which should 
make life easier:
mqAddLayer and mqRemoveLayer, I put mq in front of it to make sure we 
don't meddle with OL events.

-mqAddLayer will give you the layer object
-mqRemoveLayer will give the id of the removed layer



On 6/22/2011 12:25 PM, Steven Ottens wrote:
> hm,
>
> To complicate things further when the addLayer event is fired, the layer is not yet in mapquery.layers() and as such cannot be found.
>
> Suggestions?
>
> On Jun 22, 2011, at 11:58 AM, Steven Ottens wrote:
>
>> Hi all,
>>
>> We decided that we don't need getLayerById since to know the layer.id you need the layer object to start with. A wise choice, however now I have a new issue. The 'AddLayer' event from OpenLayers returns a OpenLayers Layer object. There is currently no easy way to get the corresponding MapQuery layer. For the LayerManager, which should add a layer to the manager after a layer has been added, I need to get the layer object.
>>
>> I could write a function to get layer by OpenLayers ID. Would it make sense to add this function to core? Or should the addlayer event somehow return the mapquery layer.
>>
>> Steven
>> _______________________________________________
>> MapQuery mailing list
>> MapQuery at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapquery
>
> _______________________________________________
> MapQuery mailing list
> MapQuery at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapquery




More information about the MapQuery mailing list