不久前,由于stackoverflow,我让这个小提琴工作了:http: //jsfiddle.net/AUbZn/16/现在它不再是了:/
似乎无论出于何种原因,请求都以 OPTION 方法发送到雅虎。这是相关部分,因为这个 url 正在被选择:
var layer = new OpenLayers.Layer.Vector("GML", {
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Fopenlayers.org%2Fdev%2Fexamples%2Fgml%2Fpolygon.xml'",
format: new OpenLayers.Format.GML(),
}),
eventListeners: {
"featuresadded": dataLoaded
},
});
知道为什么以及如何纠正它吗?