Here's the link to the openlayers ticket about the problem :
http://trac.osgeo.org/openlayers/ticket/2749
Thanks a lot!
Alexandre Lessard
_______________________________________________
Users mailing list
Us...@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
can you please enlighten me how
http://trac.osgeo.org/openlayers/ticket/2749 relates to the Print
Preview ux? To encode vector layers for printing, GeoExt does not
clone them and also doesn't serialize properties other than features
and styles, so I don't immediately see where that ticket could cause
the Print Preview ux to not work.
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
can you try if this patch solves the issue:
--- a/lib/GeoExt/widgets/PrintMapPanel.js
+++ b/lib/GeoExt/widgets/PrintMapPanel.js
@@ -193,7 +193,20 @@ GeoExt.PrintMapPanel = Ext.extend(GeoExt.MapPanel, {
this.layers = [];
var layer;
Ext.each(this.sourceMap.layers, function(layer) {
- layer.getVisibility() === true && this.layers.push(layer.clone());
+ if (layer.getVisibility() === true) {
+ if (layer instanceof OpenLayers.Vector) {
+ var features = layer.features,
+ clonedFeatures = new Array(features.length);
+ for (var i=0, ii=features.length; i<ii; ++i) {
+ clonedFeatures[i] = features[i].clone();
+ }
+ this.layers.push(new OpenLayers.Layer.Vector(layer.name, {
+ features: clonedFeatures
+ }));
+ } else {
+ this.layers.push(layer.clone());
+ }
+ }
}, this);
this.extent = this.sourceMap.getExtent();
Andreas.
On Sat, Jan 14, 2012 at 11:02 PM, Alexandre Lessard
<alexa...@solutionglobale.com> wrote:
> Hi again,
> Sorry for the lack of info.
>
> The printPreview uses the printMapPanel widget to create a copy of the
> source map, the printMapPanel is initialized in the initComponent function
> of printPreview.js.
> . While doing the copy it uses the clone function of the layers.
>
> Here the printMapPanel code link at line 196 where there is the cloning :
> https://github.com/geoext/geoext/blob/master/lib/GeoExt/widgets/PrintMapPanel.js#L196
>
> Hope this is enough.
> Thanks Again
>
> Alexandre
I tried and updated your patch a little. It solves the issue for
me. See :
https://github.com/geoext/geoext/pull/33
Regards,
Alexandre
On 12-01-14 06:10 PM, Andreas Hocevar wrote:
> Hi,
>
> can you try if this patch solves the issue:
>
> --- a/lib/GeoExt/widgets/PrintMapPanel.js
> +++ b/lib/GeoExt/widgets/PrintMapPanel.js
> @@ -193,7 +193,20 @@ GeoExt.PrintMapPanel = Ext.extend(GeoExt.MapPanel, {
> this.layers = [];
> var layer;
> Ext.each(this.sourceMap.layers, function(layer) {
> - layer.getVisibility() === true&& this.layers.push(layer.clone());
--
Alexandre Dubé
Mapgears
www.mapgears.com
I'm in the process of updating to GeoExt1.1, ExtJS3.4 and OL2.11. I'm
running into an issue that I think I've pinned down to something with my
layer tree. Basically, the base map, Google in this case, is not tiling
correctly. I have some vector features that seem to show up properly,
however the basemap is off. It's almost as if they projections between the 2
are off. If I disable the layer tree generation, the map works properly. My
test map is here: http://rcoos.org/carolinasrcoosrev2/indexDebug2.php
Although I am not sure if this is the same issue, the GeoExt example:
http://api.geoext.org/1.1/examples/tree.html does not work properly either,
the tiling is incorrect.
Was wondering if anyone experienced anything similar.
Thanks!
Dan
Reading your post again are you saying some of your vectors are off
relative to the google layers?
Ralph Dell
Now the base map tiles are aligning correctly.
The GeoExt tree example creates the nodes similarly to the way I was
creating them, and it has a basemap issue as well. Not sure if it is the
same one I had or not.
Dan
-----Original Message-----
From: Dan Ramage [mailto:d...@inlet.geol.sc.edu]
Sent: Tuesday, April 03, 2012 12:32 PM
To: 'us...@geoext.org'
Subject: Layer Tree Issues Upagrading to GeoExt v1.1
All,
I'm in the process of updating to GeoExt1.1, ExtJS3.4 and OL2.11. I'm
running into an issue that I think I've pinned down to something with my
layer tree. Basically, the base map, Google in this case, is not tiling
correctly. I have some vector features that seem to show up properly,
however the basemap is off. It's almost as if they projections between the 2
are off. If I disable the layer tree generation, the map works properly. My
test map is here: http://rcoos.org/carolinasrcoosrev2/indexDebug2.php
Although I am not sure if this is the same issue, the GeoExt example:
http://api.geoext.org/1.1/examples/tree.html does not work properly either,
the tiling is incorrect.
Was wondering if anyone experienced anything similar.
Thanks!
Dan
_______________________________________________
I think I solved it. I've sent another group email detailing what I found.
Did you look at the GeoExt
example(http://api.geoext.org/1.1/examples/tree.html) to see if that one
worked for you?
Dan