I have a WFS layer in my map. I have buildings in the layer with building_id as an attribute along with other many attributes. I have coordinates too in my layer.
I have a URL: http://localhost:8080/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=topp:buildings&CQL_FILTER=id='bb21'
How can I use this URL to zoom my map to that building?
Any ideas?
AJ
================updated here ===============
$.ajax({
url: 'http://localhost:8080/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=genesis:Building_WGS&CQL_FILTER=HOUSE_NO=%271436%27',
xhrFields: {
withCredentials: true
},
success: function(data) {
var te = new ol.format.GML2();
var a = te.readFeatures(data)
var feature = new ol.Feature(a);
//console.log(test1);
var geom = feature.get("HOUSE_NO");
var view = map.getView();
//view.fit(geom, map.getSize());
console.log(geom);
}
});