我这个js代码是写在html中的。
var url2 = "http://localhost:8090/iserver/services/data-wfs/wfs100";
vectorLayer = new SuperMap.Layer.Vector("World wenzhou", {
strategies : [ new SuperMap.Strategy.BBOX() ],
protocol : new SuperMap.Protocol.WFS({
version : "1.0.0",
srsName: "EPSG:4326",
url : url2,
featureType : "wenzhou1_行政区_社区"
// featureNS : "
http://www.supermap.com/World",
// featurePrefix : "wenzhou1",
// geometryName : "the_geom"
}),
//filter使用方式二:
filter : myFilter,
styleMap : new SuperMap.StyleMap({
'default' : vector_style,
'select' : vector_style_select
})
});
我在创建WFS对象,向url2地址查询时,浏览器提示
XMLHttpRequest cannot load http://localhost:8090/iserver/services/data-wfs/wfs100. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
这个怎么解决?