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 <a href="http://github.com/openlayers/openlayers">http://github.com/openlayers/openlayers</a>.<br>
<br>Andreas.<br><br>On Wednesday, May 30, 2012, jorgelopez <<a href="mailto:jorgelopez.physics@gmail.com">jorgelopez.physics@gmail.com</a>> wrote:<br>> Hello:<br>><br>><br>> I have a Google and WMS layers loaded into a map and I am trying to clone<br>
> these ones in<br>> order to be loaded into another map (with different div) associated to a<br>> child (opened) window page.<br>><br>> There is no problem to clone OL-based WMS layers and they are correctly<br>
> added to map div<br>> but Google base layers are not shown.<br>><br>> Here is my code:<br>><br>> // function that returns an array of (cloned!) active layers in an opener<br>> window<br>> function returnActivaLayersFromOpener() {<br>
><br>>                                                var activ = [];<br>><br>>                                                for (layername in opener.map.layers) {<br>>                                                                        // if the layer isn't visible at this range, or is turned off, skip<br>
> it<br>>                                                                        var layer = opener.map.layers[layername];<br>>                                                                                        if (layer.visibility) {<br>
>                                                                                                                                                                                                                                                var layerc<br>
> = layer.clone();<br>>                                                                                                        //console.log(layer);<br>>                                                                                                        activ.push(layerc);<br>
><br>>                                                                                        }<br>>                                                }<br>><br>>                                                return activ;<br>
> };<br>><br>> activelayers = returnActivaLayersFromOpener();<br>><br>> // add cloned layers to a map in a opened window<br>><br>> map_child = new OpenLayers.Map({options});<br>><br>> map_child.addLayers(activelayers);<br>
><br>><br>> I dont know why WMS are correctly shown but, on the contrary, Google layers<br>> are not shown (I checked they are included as item in the activelayers<br>> array).<br>><br>> I have followed this ticket regarding Google.js,<br>
><br>> ticket: <a href="http://trac.osgeo.org/openlayers/attachment/ticket/2473/2473.patch">http://trac.osgeo.org/openlayers/attachment/ticket/2473/2473.patch</a><br>><br>> but there is no succeed.<br>><br>
> Any help would be appreciated<br>><br>> Jorge<br>><br>><br>> --<br>> View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/clone-Google-Layers-tp4977932.html">http://osgeo-org.1560.n6.nabble.com/clone-Google-Layers-tp4977932.html</a><br>
> Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>> _______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>><br><br>-- <br>Andreas Hocevar<br>OpenGeo - <a href="http://opengeo.org/">http://opengeo.org/</a><br>
Expert service straight from the developers.<br><br>