/* WMS Javascript 샘플 코드 */
var xhr = new XMLHttpRequest();
var url = 'http://apis.data.go.kr/B090026/BsnsAreaService/getInfoWMS'; /*URL*/
var queryParams = '?' + encodeURIComponent('ServiceKey') + '='+'서비스키'; /*Service Key*/
queryParams += '&' + encodeURIComponent('srs') + '=' + encodeURIComponent('좌표체계'); /*지도의 좌표체계*/
queryParams += '&' + encodeURIComponent('bbox') + '=' + encodeURIComponent('화면지도영역bbox'); /*화면상의지도영역 bbox*/
queryParams += '&' + encodeURIComponent('width') + '=' + encodeURIComponent('이미지width(px)'); /*이미지width(px)*/
queryParams += '&' + encodeURIComponent('height') + '=' + encodeURIComponent('이미지height(px)'); /*이미지height(px)*/
queryParams += '&' + encodeURIComponent('format') + '=' + encodeURIComponent('반환이미지format'); /*반환이미지format*/
queryParams += '&' + encodeURIComponent('transparent') + '=' + encodeURIComponent('반환이미지투명여부'); /*반환이미지투명여부*/
xhr.open('GET', url + queryParams);
xhr.onreadystatechange = function () {
if (this.readyState == 4) {
alert('Status: '+this.status+' Headers: '+JSON.stringify(this.getAllResponseHeaders())+' Body: '+this.responseText);
}
};
xhr.send('');