以下是源代码,这个问题搞了我8个小时,郁闷死了。version为1.1.0的wfs服务,默认返回的GML带个节点叫<gml:featureMember
s>,所有的format源代码查一遍,调试很久,还是不知道怎么解析,已经准备放弃自己写解析类了。突然想起试下以前的version1.0.0和outputformat:GML2,行了。虽然解决了,还是很郁闷,浪费了这么长的时间啊!!!
trms.GetFeaturesToDeleteVectorLayerControl = OpenLayers.Class(OpenLayers.Control, {
draw: function() {
this.handler = new OpenLayers.Handler.Box( this,
{done: this.zoomBox}, {keyMask: this.keyMask} );
},
zoomBox: function (position) {
if (position instanceof OpenLayers.Bounds) {
if (!this.out) {
var minXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.left, position.bottom));
var maxXY = this.map.getLonLatFromPixel(
new OpenLayers.Pixel(position.right, position.top));
var bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
maxXY.lon, maxXY.lat);
} else {
var pixWidth = Math.abs(position.right-position.left);
var pixHeight = Math.abs(position.top-position.bottom);
var zoomFactor = Math.min((this.map.size.h / pixHeight),
(this.map.size.w / pixWidth));
var extent = this.map.getExtent();
var center = this.map.getLonLatFromPixel(
position.getCenterPixel());
var xmin = center.lon - (extent.getWidth()/2)*zoomFactor;
var xmax = center.lon + (extent.getWidth()/2)*zoomFactor;
var ymin = center.lat - (extent.getHeight()/2)*zoomFactor;
var ymax = center.lat + (extent.getHeight()/2)*zoomFactor;
var bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
}
var bbox = bounds.left + ',' + bounds.bottom + ',' + bounds.right + ',' + bounds.top;
var params = {
service : 'WFS',
version : '1.0.0',
request : 'GetFeature',
typeName : 'shane:guandao_renkong,shane:guandao_guandao,shane:ganlu_diangan,shane:ganlu_diaoxian',
OUTPUTFORMAT : 'GML2',
SRSNAME : 'EPSG:4326',
BBOX : bbox
};
OpenLayers.loadURL("/geoserver/wfs", params, this.map, function(response) {
var g = new OpenLayers.Format.GML();
var features = g.read(response.responseText);
alert(features.length);
});
}
}
});
分享到:
相关推荐
features
features.h 标准c/c++头文件下载
The CTP contains a number of walkthroughs, some of which highlight the new language features of C# 4.0. Those are excellent for getting a hands-on guided tour through the details of some common ...
bag of features 的一个PPT 做的不错的
Java Language Features, 2nd Edition,介绍了注解,内部类、IO、持久化等java特性。比较适合深入研究的人员。
Java Language Features: With Modules, Streams, Threads, I/O, and Lambda Expressions Work with essential and advanced features of the Java programming language such as Java modules development, lambda ...
cpu_features:一个跨平台的gnu89库在运行时获得cpu特性
IEMOCAP数据集
Api-ogcapi-features.zip,在web.ogc api上查询地理空间信息的开放标准-功能,一个api可以被认为是多个软件设备之间通信的指导手册。例如,api可用于web应用程序之间的数据库通信。通过提取实现并将数据放弃到对象中,...
SURF算法的经典原文,SURF (Speeded Up Robust Features)也是一种类似于SIFT的兴趣点检测及描述子算法。其通过Hessian矩阵的行列式来确定兴趣点位置,再根据兴趣点邻域点的Haar小波响应来确定描述子,其描述子大小...
An Extended Set of Haar-like Features for Rapid Object Detection.pdf和Rapid Object Detection using a Boosted Cascade of Simple.pdf 都是了解Haar特征最经典的文献。
In this paper, we propose an accurate edge detector using richer convolutional features (RCF). Since objects in natural images possess various scales and aspect ratios, learning the rich hierarchical ...
java7 new features cookbook
Lowe的论文《Distinctive Image Features from Scale-Invariant Keypoints》翻译
Fluent_2022_R1 Beta_Features_Manual
nand flash memory features specification micron公司
Introduction to the features of SAS
适合理解bag of features,考虑patch之间的空间关系
Oracle database new features Guide.pdf
关于手写数字Multiple+Features数据集的贝叶斯分类