This looks like the feature you pass to PrintWalk does not belong to a layer. You will need to provide more context so we can see what is wrong.
Andreas. On Fri, Feb 15, 2013 at 10:01 AM, Thomas Colley <it...@neath-porttalbot.gov.uk> wrote: > 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 > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. _______________________________________________ Users mailing list Users@geoext.org http://www.geoext.org/cgi-bin/mailman/listinfo/users