1
我想從Geoserver 2.3.0解析URL並嘗試疊加在地圖上的openlayers.JPG無法獲取對象。我收到的錯誤是:SyntaxError:missing;之前的聲明 {「type」:「FeatureCollection」,「features」:[{「type」:「Feature」,「id」:「KalGeoserver WFS url解析錯誤SyntaxError:missing;之前的聲明
我試過用$ .getJSON以及$ .ajax但錯誤是一樣的
我使用利用Geoserver 2.3.0和2.13的OpenLayers
代碼來獲得JSON對象我使用:
$('#getData').click(function(){
var url = 'http://localhost:8089/geoserver/oifam/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=oifam:Kalamboli_WaterShed&maxFeatures=50&outputFormat=json';
$.ajax({
type:"GET",
url:url,
success: function(data) {
alert(data);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.status);
},
dataType: "jsonp"
})
});