※ 오픈레이어스를 사용하기 위해서 상속을 받아야 된다.
Method
/* 오픈스트리트맵 */
const openSt = new ol.layer.Tile({
target: 'o2map'
source: new ol.source.OSM(),
visible: true,
opacity: 1
})
if you use this code You face a error like this.
(It wasn't working normally.)
You should surround layer parameter by using array '[]'
If you don't surround a layer parameter It will be not worked.
Usage
const map = new ol.Map ({
target: 'o2map',
layers:
[ /* 이 배열 구조는 필수 이다. */
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View ({
center: [127, 37.5], /* 필수적으로 center는 잡아줘야된다. */
zoom: 6, /* zoom도 필수적으로 1~12 사이 값을 넣어줘야된다. */
projection: 'EPSG:4326' /* default 좌표가 잡혀져있따. 필수는 아님. */
})
})

https://chocoboy.tistory.com/386
[Openlayers] 오픈레이어스 LineString 사용 방법
너무 간단해서 깜딱 놀랐다. '점' 찍어봤다면 이건 거의 3분 카레수준으로 해볼수 있을 것이다. Method const lineLayer = new ol.Feature ({ geometry: new ol.geom.LineString([[133, 38],[133, 55]]) }) 다음과 같이 설정해
chocoboy.tistory.com
https://chocoboy.tistory.com/385
[Openlayers] 오픈레이어스 Point 찍는 방법
최근들어 오픈레이어스를 많이 사용하게 되어가지고, 오픈레이어스 공부를 본의아니게 하게 되었다. Method 간단하게, 오픈레이어스의 구조를 설명해보자면 다음과 같은 구조로 이루어져 있다.
chocoboy.tistory.com
To be continue..
'Career > Openlayers' 카테고리의 다른 글
[Openlayers] Openlayers Heatmap Usage (0) | 2023.02.01 |
---|---|
[Openlayers] Openlayers code storage (0) | 2023.01.26 |
[Openlayers] 오픈레이어스 Polygon 사용방법 (0) | 2023.01.19 |
[Openlayers] 오픈레이어스 ol.geom.style 사용방법 (0) | 2023.01.19 |
[Openlayers] 오픈레이어스 LineString 사용 방법 (0) | 2023.01.19 |