我试图从样本WMS的GetFeatureInfo得到响应。但是获取“无法加载 http://ogi.state.ok.us/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&SRS=EPSG:4326&BBOX=-104.5005,32.7501,-94.01,37.20&WIDTH=800&HEIGHT=300&LAYERS=ogi:okcounties&QUERY_LAYERS=ogi:okcounties&STYLES=&X=550&Y=105& 状态: 0"
var httpurl = "http://ogi.state.ok.us/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&SRS=EPSG:4326&BBOX=-104.5005,32.7501,-94.01,37.20&WIDTH=800&HEIGHT=300&LAYERS=ogi:okcounties&QUERY_LAYERS=ogi:okcounties&STYLES=&X=550&Y=105&";
try {
require(["dojo/request"], function (request) {
var promise = request(httpurl);
promise.response.then(
function (response) {
var kk = response;
},
function (error) {
var kk = error;
}
);
});
} catch (ex) {
alert(ex.message);
}发布于 2017-01-04 15:51:44
我看到了一些潜在的问题:
.then()打电话。像这样:
Promise.then(.);var kk = data; .您使用的是变量data,但应该使用response。https://stackoverflow.com/questions/41460724
复制相似问题