[MapQuery] Re: OpenLayers.Layer.Vector.RootContainer

Volker Mische volker.mische at gmail.com
Sun May 20 13:05:40 EDT 2012


Hi Giuseppe,

On 05/19/2012 04:56 PM, Giuseppe De Marco wrote:
>> Does mq.lqyers() also return the OpenLayers.Layer.Vector.RootContainer?
>> If that's the case it's a bug.
> 
> Maybe it is. 
> I'm dealing with mapquery and when I create a new mq layer I found 2 new
> layers in ol's map.layers.
> 
> If I destroy OpenLayers.Layer.Vector.RootContainer The mplayermanager
> doesn't remove the created layers using the topleft close icon. This
> made me think that OpenLayers.Layer.Vector.RootContainer is necessary
> also is is not managed in mq sources.
> 
> Thank you Volker
> g

You shouldn't access the OpenLayers layers directly, use the MapQuery
API. In you case you have to use a bit of OpenLayers directly, as you
add a new layer type. Though you should just be able to add a new type
and then use the MapQuery API from then on. If you still need direct
access to OpenLayers, you either do it wrong, or you use something that
is not supported by MapQuery. In the latter case, feel free to tell what
you miss.

When I call $('#map').data('mapQuery').layers(); in the LayerManager
example I just get 2 layers back as expected, no sign of the
OpenLayers.Layer.Vector.RootContainer.

Cheers,
  Volker


More information about the MapQuery mailing list