-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path66_!_imageReprojection.html
60 lines (52 loc) · 1.79 KB
/
66_!_imageReprojection.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="ol.js"></script>
<link rel="stylesheet" href="ol.css">
<script
src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL">
</script>
</head>
<script>
// :
//기본 : Map View Source Layer
//추가 : extend(applyTransform), proj
</script>
<body>
<!-- 기본틀로 사용하는 양식 -->
<div id="map" class="map"></div>
<script>
new ol.proj4.defs('EPSG:27700', '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 ' +
'+x_0=400000 +y_0=-100000 +ellps=airy ' +
'+towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 ' +
'+units=m +no_defs');
register(proj4);
var imageExtent = [0, 0, 700000, 1300000];
var map = new Map({
layers: [
new TileLayer({
source: new OSM()
}),
new ImageLayer({
source: new Static({
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/' +
'British_National_Grid.svg/2000px-British_National_Grid.svg.png',
crossOrigin: '',
projection: 'EPSG:27700',
imageExtent: imageExtent
})
})
],
target: 'map',
view: new View({
center: transform(getCenter(imageExtent), 'EPSG:27700', 'EPSG:3857'),
zoom: 4
})
});
</script>
</body>
</html>