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

 

 

_______________________________________________
Users mailing list
Users@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to