http://gis.stackexchange.com/questions/70990/request-wfs-from-geoserver-with-jquery-ajax-using-intersect-cql-filter-error


http://gis.stackexchange.com/questions/34892/how-to-get-json-from-geoserver-using-ajax-request


http://gis.stackexchange.com/questions/27468/how-do-i-get-geojson-data-from-geoserver-into-show-up-on-my-leaflet-map


http://gis.stackexchange.com/questions/48522/geoserver-callback-function-undefinded




http://docs.geoserver.org/latest/en/user/services/wfs/outputformats.html



http://gis.stackexchange.com/questions/76638/geoserver-2-4-1-how-to-use-jsonp-in-a-wfs-request


web.xml

<context-param>
    <param-name>ENABLE_JSONP</param-name>
    <param-value>true</param-value>
</context-param>




var wfsParams = {

service: 'WFS',

version: '1.1.0',

request: 'GetFeature',

typeName: 'vizm:tl_scco_sig',

maxFeatures: '50',

srsName: 'EPSG:4326',

outputFormat: 'text/javascript',

format_options: 'callback:responseJSON'

};



$.ajax({

url: 'http://localhost:8081/geoserver/vizm/wfs',

data: $.param(wfsParams),

type: 'GET',

jsonpCallback: 'responseJSON',

dataType:'jsonp',

success: function(data) { 

//alert('success');

console.debug(data);

L.geoJson(data, {

onEachFeature: function(feature, layer) {

var popupContent = "</p>" + feature.geometry.type + "</p>";

if (feature.properties && feature.properties.sig_kor_nm) {

popupContent += feature.properties.sig_kor_nm + '(' + feature.properties.sig_eng_nm + ')';

}

layer.bindPopup(popupContent);

}

}).addTo(map);


}, 

error: function(xhr, status, thrown) {

alert(status);

}

});




신고



티스토리 툴바