[Users] Fit GeoExt PrintPage to extent of a feature

Thomas Colley it087 at neath-porttalbot.gov.uk
Fri Feb 15 10:01:18 CET 2013


Hi Everyone

 

I am trying to add a print function to a map using GeoExt and the
Geoserver print module.

 

Users click on a feature to bring up an information popup with a print
button in it. When the print button is clicked I would like the
PrintPage extent to fit to the feature. I am not having much luck so
far. Below is the print function. 

 

      PrintWalk = function(feature) {

            var featGeom = feature.geometry

            printPage.fit(feature, true);

}

 

The error I get is: 

               TypeError: fitTo.layer is null                GeoExt.js
(line 166)

 

I have also tried printPage.fit(featGeom, true); instead it is looking
for the geometry rather than the feature itself but then I get 
               TypeError: map.getExtent is not a function    GeoExt.js
(line 167)
 
The feature geometry being passed through is a multilinestring. 
 
Using printPage.fit(map, true) prints fine. 
 
I would be very grateful if anyone has any ideas what I'm doing wrong.
 
Thanks
 
Tom

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20130215/a6fe3ae3/attachment.htm 


More information about the Users mailing list