代码:
``` var url = "http://*******/arcgis/services/layer/MapServer/WMSServer";
var dat = {
VERSION: "1.3.0", REQUEST: "GetFeatureInfo", QUERY_LAYERS: "topp:states",
BBOX: "*,*,*,*", crs: "4326", INFO_FORMAT: "text/javascript",
I: "200", J: "100", WIDTH: "256", HEIGHT: "256", layers: "topp:states"
}
$.ajax({
type:'GET',
url: url,
data: dat,
success: function (data) {
console.log(data);
},
error: function (errormsg) {
console.log(errormsg);
}
});
但是提示:
Failed to load http://****** No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
好像是跨域问题,就采用jsonp跨域,但是返回数据格式错误,提示:
Uncaught SyntaxError: Unexpected token <
主要是想点击wms地图获取属性信息,想请教各位怎么获取wms的属性信息?