Angularjs 在openlayers3中使用WFST更新属性信息
我正在开发一个web应用程序,需要在其中更新来自geoserver的功能的属性。我尝试使用下面的代码更新属性信息Angularjs 在openlayers3中使用WFST更新属性信息,angularjs,openlayers-3,Angularjs,Openlayers 3,我正在开发一个web应用程序,需要在其中更新来自geoserver的功能的属性。我尝试使用下面的代码更新属性信息 this.update = function(p,f) { var formatWFS = new ol.format.WFS(); var formatGML = new ol.format.GML({ featureNS: 'http://www.openplans.org/topp', /*namespace URI */
this.update = function(p,f) {
var formatWFS = new ol.format.WFS();
var formatGML = new ol.format.GML({
featureNS: 'http://www.openplans.org/topp', /*namespace URI */
featureType: 'MultiPolygon',
srsName: 'EPSG:3857'
});
switch (p) {
case 'update':
node = formatWFS.writeTransaction([f], null, null, formatGML);
break;
}
s = new XMLSerailizer();
str = s.serializeToString(node);
$.ajax('http://localhost:8080/geoserver/wfs', {
type: 'POST',
dataType: 'xml',
processData: false,
contentType: 'text/xml',
data: str
}).done();
}
点击事件
<div class="btn-group">
<button class="btn btn-default" ng-disabled="ctrl.saveFeature" ng-click="ctrl.update('update',ctrl.selected_property['layer']['features'])"><span class="fa fa-save"></span> Update</button>
</div>
那么你想要什么呢?它显示的是TypeError:b.Oa不是一个函数
0:
$$hashKey: "object:271"
geometry: {type: "MultiPolygon", coordinates: Array(1)}
geometry_name: "the_geom"
id:"tn_naturals.377"
properties:
NAME:""
TYPE:"forest123"
type:"Feature"