[OpenLayers-Users] clone Google Layers
Andreas Hocevar
ahocevar at opengeo.org
Tue May 29 23:48:47 PDT 2012
The patch you tried was for the 2.x version of the GMaps API. Looks like
there are also cloning issues with v3. If possible, please create a ticket
on http://github.com/openlayers/openlayers.
Andreas.
On Wednesday, May 30, 2012, jorgelopez <jorgelopez.physics at gmail.com> wrote:
> Hello:
>
>
> I have a Google and WMS layers loaded into a map and I am trying to clone
> these ones in
> order to be loaded into another map (with different div) associated to a
> child (opened) window page.
>
> There is no problem to clone OL-based WMS layers and they are correctly
> added to map div
> but Google base layers are not shown.
>
> Here is my code:
>
> // function that returns an array of (cloned!) active layers in an opener
> window
> function returnActivaLayersFromOpener() {
>
> var activ = [];
>
> for (layername in
opener.map.layers) {
> //
if the layer isn't visible at this range, or is turned off, skip
> it
>
var layer = opener.map.layers[layername];
>
if (layer.visibility) {
>
var layerc
> = layer.clone();
>
//console.log(layer);
>
activ.push(layerc);
>
>
}
> }
>
> return activ;
> };
>
> activelayers = returnActivaLayersFromOpener();
>
> // add cloned layers to a map in a opened window
>
> map_child = new OpenLayers.Map({options});
>
> map_child.addLayers(activelayers);
>
>
> I dont know why WMS are correctly shown but, on the contrary, Google
layers
> are not shown (I checked they are included as item in the activelayers
> array).
>
> I have followed this ticket regarding Google.js,
>
> ticket: http://trac.osgeo.org/openlayers/attachment/ticket/2473/2473.patch
>
> but there is no succeed.
>
> Any help would be appreciated
>
> Jorge
>
>
> --
> View this message in context:
http://osgeo-org.1560.n6.nabble.com/clone-Google-Layers-tp4977932.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120530/074737d8/attachment.html>
More information about the Users
mailing list