MapServer WMS를 통해 래스터 레이어를 추가하기 위해 Openlayer3을 사용하고 있습니다. 페이지를로드 할 때 CRS 값이 WMS URL에서 3857로 변경됩니다.Openlayer 3 WMS (지도 서버)에서 CRS를 수정하는 방법?
작업 맵 서버의 URL
http://localhost/cgi-bin/mapserv.exe?map=D : \ 맵 서버의 \의 actualimage.map & SERVICE = WMS & VERSION = 1.3.0 & REQUEST =의 GetMap & LAYERS = 구자라트 & STYLES = & CRS = EPSG : 32,643 & BBOX = 361600.51891405135 = 이미지/PNG
openlayer 500 & 포맷 요청 = 2404154.8014285564,366487.012412889862409041.294927395 & & WIDTH = 800 HEIGHT \ 맵 서버의 \의 actualimage.map & SERVICE = WMS & VERSION = 1.3.0 & REQUEST =의 GetMap & FORMAT = 이미지/PNG & TRANSPARENT = true를
아래의 URL은
http://localhost/cgi-bin/mapserv.exe?map=D로 디코딩 LAYERS = & & 구자라트 = CRS EPSG : 3857 BBOX = & & 360378.8955393417,2402933.1780538466367708.6357875995,2410262.918302105 WIDTH = 1만약 같은 투영 'EPSG:32643'
를 등록하지 않는 높이 0 = 1 = & STYLES 이하
가 Openlayer 코드
var layers = [
new ol.layer.Image({
extent: [361600.51891405135,2404154.8014285564,366487.01241288986,2409041.294927395],
source: new ol.source.ImageWMS({
url: encodeURI('http://localhost/cgi-bin/mapserv.exe?map=D:\\mapserver\\actualimage.map'),
params: {
'LAYERS': 'Gujarat',
'CRS': 'EPSG:32643',
'BBOX': '361600.51891405135,2404154.8014285564,366487.01241288986,2409041.294927395',
'WIDTH': '800',
'HEIGHT': '500',
'FORMAT': 'image/png'
},
serverType: 'mapserver',
projection: ol.proj.get('EPSG:32643'),
})
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: [361600.51891405135, 2404154.8014285564],
zoom: 1
})
});