Probably the extent of the layer defaults to the extent of the map, so nothing happens. You can easily check this with Firebug.
I see 2 options: 1) you loop over alle the features in the layer and calculate the bounds yourself 2) you look at my patch for ticket 1613 (http://trac.openlayers.org/ticket/1613) which also parses the boundedBy element from a GML file (assuming your GML file has a boundedBy for the whole feature collection). Btw, please don't cross-post to users and dev if it is not really necessary. Best regards, Bart > Hi folks > > i want to zoom to the extent auf a GML-Layer, after it has been loaded. > > My idea is: > > 1. defining the layer, name it aLayer > 2. adding a "loadend"-event to the layer > 3. zooming map to maxextent() > 4. within the loadend-function I say > map.zoomToExtent(aLayer.getExtent()); > > Theoretically it sounds good, but in partical work there is a problem: > > map.zoomToExtent(aLayer.getExtent()); does not redraw my map > > any ideas why ? > > -- > Mit freundlichen Grüßen / Yours faithfully > Carsten Eider > > Dipl. Inf. (FH) > > Kompetenzzentrum für Innovative Informationssysteme > > c/o Fachhochschhule Bingen / University of applied sciences Bingen > > Berlinstraße 109 > 55411 Bingen > > Tel: +49 (0) 6721 / 409-179 > Fax: +49 (0) 6721 / 409-158 > email: [EMAIL PROTECTED] > Internet: iis.fh-bingen.de > > _______________________________________________ > Dev mailing list > [email protected] > http://openlayers.org/mailman/listinfo/dev > _______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
