gdal์์ ์์ฑํ ์ฌ์ฉ์ ์ง์ ํ์ผ์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. 1.0์์ ํ์ผ์ ํ๋ ํ y์ถ์์ ๋ฐ์ ๋ฉ๋๋ค. tms
๋ฅผ true์์ false๋ก ์ ํํ๋ ค๊ณ ์๋ํ์ง๋ง ํจ๊ณผ๊ฐ ์์์ต๋๋ค. ๋ํ ์๋ก์ด {-y}
๊ธฐ๋ฅ(tms ์ต์
์ด ์ ๊ฑฐ๋ ์ํ)์ ์๋ํ์ง๋ง "๋ณ์ {-y}์ ๋ํด ๊ฐ์ด ์ ๊ณต๋์ง ์์" ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
์ ์ ์ฃผ์๋ฅผ ๋ง์ง์๊ฑฐ๋ฆฌ๋ค๊ฐ 1.0 ๋์ 0.6.4๋ฅผ ์ฐธ์กฐํ๊ณ ๋ชจ๋ ๊ฒ์ด ์๋ํฉ๋๋ค.
Btw, 0.7.7์ ๋ํ cdn ๋งํฌ๊ฐ ๋ค์ด๋ ๊ฒ ๊ฐ์ต๋๋ค. http://cdn.leafletjs.com/leaflet-0.7.7/leaflet.js
1.0์ฉ https://unpkg.com/[email protected]/dist/leaflet.js์ ๋ํ ๋งํฌ
var map = L.map('map', {
crs: L.CRS.Simple,
center: L.latLng(-128, 128),
zoom: -2
});
L.tileLayer('/map/{z}/{x}/{y}.png', {
noWrap: true,
attribution: 'WW',
detectRetina: false,
bounds: L.latLngBounds(
L.latLng(-256, 0),
L.latLng(0, 256)
),
tms: true,
minZoom: 0,
maxZoom: 4
}).addTo(map);
๋๋ฅผ ์ํด ์๋ํฉ๋๋ค. http://playground-leaflet.rhcloud.com/bahu/edit?html , output ์ฐธ์กฐ
๋ค์์๋ TMS์ ์ค์ ์ฌ๋ก๊ฐ ํฌํจ๋ WMS/TMS ํํ ๋ฆฌ์ผ์ ํ์ธํ๊ณ ์ค์ ๋ฒ๊ทธ ๋ณด๊ณ ์์ ๊ฐ์ ๋ฒ๊ทธ ๋ณด๊ณ ์๋ฅผ ์์ฑํ์ญ์์ค.
๋ง์ต๋๋ค. ์ด๋ฏธ (๋ฐ ๋ชจ๋ ์์ต์) ์ฝ์์ง๋ง TMS์ ํจ๊ป ์ฌ์ฉ์ ์ง์ ํ์ผ์๋ ์ค์ ๋ก ์ ์ฉ๋์ง ์์ต๋๋ค. ๊ฐ์ฅ ๊ฐ๊น์ด ํํ ๋ฆฌ์ผ์ http://leafletjs.com/examples/crs-simple/crs-simple.html์ ๋๋ค. ๋ค์ ๋ํดํ ์ฃผ์ ์ด๊ธฐ ๋๋ฌธ์ ์๋ด๋ฅผ ๊ธฐ๋ํ์ต๋๋ค. ๋ค์ ๋ฒ์ Stackoverflow์ ๋ํด ์ง๋ฌธํ๊ฒ ์ต๋๋ค.
CRS.Simple์ GDAL์ ์ํด ์์ฑ๋ ํ์ผ๋ง์ผ๋ก ์์ ํ๋ ค๋ ๋ค๋ฅธ ์ฌ๋ ์ ๊ฒฝ์ฐ ์ด ์ฝ๋ ๋ธ๋ก ์ผ๋ก ์ธํด ๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฒ ๊ฐ์ต๋๋ค.
if (this._map && !this._map.options.crs.infinite) {
var invertedY = this._globalTileRange.max.y - coords.y;
if (this.options.tms) {
data['y'] = invertedY;
}
data['-y'] = invertedY;
}
y
๋ CRS.Simple์์ infinite
๊ฐ true๋ก ์ค์ ๋์ด ์๊ธฐ ๋๋ฌธ์ ์ ๋ ๋ฐ์ ๋์ง ์์ต๋๋ค. ๋ฌดํ = false๋ก CRS.Simple์ ์ฌ์ฉ์ ์ง์ ๋ณต์ฌ๋ณธ์ ๋ง๋๋ ๊ฒ์ด ๋ด ์ํฉ์ ๋์์ด ๋์์ต๋๋ค.