차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
tech:leafletjs [2015/12/11 16:24] – V_L | tech:leafletjs [2023/07/25 06:04] (현재) – V_L | ||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | {{tag> | ||
====== Leafletjs ====== | ====== Leafletjs ====== | ||
줄 10: | 줄 11: | ||
http:// | http:// | ||
+ | |||
+ | =====예제===== | ||
+ | |||
+ | ====타일맵==== | ||
+ | <file html> | ||
+ | < | ||
+ | < | ||
+ | <link rel=" | ||
+ | href=" | ||
+ | <script src=" | ||
+ | < | ||
+ | #map { height: 360px; } | ||
+ | </ | ||
+ | <script language=" | ||
+ | function onLoAd() | ||
+ | { | ||
+ | var map = L.map(' | ||
+ | L.tileLayer(' | ||
+ | { | ||
+ | maxZoom: 6, | ||
+ | minZoom: 2, | ||
+ | continuousWorld: | ||
+ | noWrap: | ||
+ | tms:true, | ||
+ | attribution: | ||
+ | id: ' | ||
+ | } | ||
+ | ).addTo(map); | ||
+ | map.setView([-55, | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | <body onLoad=" | ||
+ | <div id=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | ====단일이미지==== | ||
+ | | ||
+ | |||
+ | <file html> | ||
+ | < | ||
+ | < | ||
+ | <link rel=" | ||
+ | href=" | ||
+ | <script src=" | ||
+ | < | ||
+ | #map { height: 360px; | ||
+ | width: | ||
+ | </ | ||
+ | <script language=" | ||
+ | function onLoAd() | ||
+ | { | ||
+ | |||
+ | // create the slippy map | ||
+ | var map = L.map(' | ||
+ | minZoom: 1, | ||
+ | maxZoom: 4, | ||
+ | center: [0, 0], | ||
+ | zoom: 1, | ||
+ | crs: L.CRS.Simple | ||
+ | }); | ||
+ | |||
+ | // dimensions of the image | ||
+ | var w = 4158, | ||
+ | h = 4155, | ||
+ | url = ' | ||
+ | |||
+ | // calculate the edges of the image, in coordinate space | ||
+ | var southWest = map.unproject([0, | ||
+ | var northEast = map.unproject([w, | ||
+ | var bounds = new L.LatLngBounds(southWest, | ||
+ | |||
+ | // add the image overlay, | ||
+ | // so that it covers the entire map | ||
+ | L.imageOverlay(url, | ||
+ | |||
+ | // tell leaflet that the map is exactly as big as the image | ||
+ | map.setMaxBounds(bounds); | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | <body onLoad=" | ||
+ | <div id=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | =====플러그인===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
- | {{tag> |