Hi Jeff,
In my app I zoom to the largest feature successfully. I sub-classed Layer.GML and overrode the
 requestSuccess function:

    /**
* Overrides the ajax return process to immediately zoom to the fetched feature.
     */
    requestSuccess:function(request) {

        var doc = request.responseXML;

        if (!doc || request.fileType!="XML") {
            doc = request.responseText;
        }

        map.GML = doc;
var gml = this.format ? new this.format() : new OpenLayers.Format.GML();

        this.addFeatures(gml.read(doc));

        // zoom to the extent of the largest geom
        this.maxIndex = 0;
        var i;
        for (i=0;i<=this.features.length - 1;i++) {
if (parseFloat(this.features[i].geometry.getArea()) > parseFloat(this.features[this.maxIndex].geometry.get\
Area())) {
                this.maxIndex = i
            }
        }
map.zoomToExtent(this.features [this.maxIndex].geometry.getBounds());

    },

Hope this helps.




Roger Kunkel
CERES Program
Dept. of Land Air & Water Resources
UC Davis
[EMAIL PROTECTED]


_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to