[OpenLayers-Users] getDataExtent() for GML layer?

Robert Sanson SansonR at asurequality.com
Thu Oct 16 18:44:09 EDT 2008


I couldn't get getDataExtent()) to work for a OpenLayers.Layer.GML
 
I changed to a OpenLayers.Layer.Vector and then it worked:
 
var g =  new OpenLayers.Format.GML();
 
var fbndurl = "http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&SRS=EPSG:2193&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120 ( 'http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&SRS=EPSG:2193&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120' )";
OpenLayers.loadURL(fbndurl, '', this, fbndreturn);
 
function fbndreturn(fbndresponse) {
              fbnd = new OpenLayers.Layer.Vector("Farm boundary",
                  {isBaseLayer: false,
                   style: farm_style, 
                   extractAttributes: true }); 
              fbnd.addFeatures(g.read(fbndresponse.responseText));
              map.addLayer(fbnd);
              map.zoomToExtent(fbnd.getDataExtent());
}
Robert

>>> Christopher Schmidt <crschmidt at metacarta.com> 17/10/2008 11:11 a.m. >>>
On Fri, Oct 17, 2008 at 11:08:17AM +1300, Robert Sanson wrote:
> Does anyone know if Layer function getDataExtent() has been implemented for a GML layer constructed with:

The singleTile option is completely useless... as is the
extractAttributes option, I'm pretty sure...

Anyway, "yes, as of 2.7."

-- Chris

> fbnd = new OpenLayers.Layer.GML("Farm boundary",
>                 "http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&request=getfeature&typename=farm&service=wfs&version=1.0.0&SRS=EPSG:2193&BBOX="+x1+","+y1+","+x2+","+y2+"&maxfeatures=120 ( 'http://10.65.192.1/cgi-bin/agbwfs.exe?farmid="+farmid+"&amp;request=getfeature&amp;typename=farm&amp;service=wfs&amp;version=1.0.0&amp;SRS=EPSG:2193&amp;BBOX="+x1+","+y1+","+x2+","+y2+"&amp;maxfeatures=120' )",
>                 {singleTile: true, style: farm_style, extractAttributes: true});
>  
> ?
>  
> Many thanks,
> 
> Robert
> ------------------------------------------------------------------
> The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
> ------------------------------------------------------------------
> 
> 
> This message has been scanned for malware by SurfControl plc. www.surfcontrol.com 

> _______________________________________________
> Users mailing list
> Users at openlayers.org 
> http://openlayers.org/mailman/listinfo/users 


-- 
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
Users at openlayers.org 
http://openlayers.org/mailman/listinfo/users 

------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081017/53a8db45/attachment.html


More information about the Users mailing list