Leaflet, Modest Maps, mapbox.js ã§ã®é»åå½åç»åã¿ã¤ã«ã®è¡¨ç¾æ¹æ³
Leaflet, Modest Maps, mapbox.js ã§é»åå½åç»åã¿ã¤ã«ã表示ãã¦ã¿ããOpenLayers ã¯ãªãªã¸ãã«ã®é»åå½åWebã·ã¹ãã ã使ç¨ãã¦ããã®ã§å²æãã¦ããã
- Leaflet http://www.handygeospatial.info/2012/10/15/
- Modest Maps http://www.handygeospatial.info/2012/10/25/
- mapbox.js http://www.handygeospatial.info/2012/10/28/
ããããã«ã¤ãã¦ãé»åå½åç»åã¿ã¤ã«ã¬ã¤ã¤ãè¨è¼ããæ¹æ³ãæ½åºãã¦ã¿ãã¨ã次ã®ã¨ããã
Leaflet
ç¬èªæ¡å¼µã®ãã³ãã¬ã¼ã表ç¾ã§ç¡çãã L.TileLayer ãä½ã£ããã¨ãL.TileLayer#getTileUrl ãã¢ã³ãã¼ãããããã¤ã¡ã¼ã¸ã ãæ¯è¼çãã¼ãã£ãªããæ¹ã ã¨æãã
var l = L.tileLayer('http://cyberjapandata.gsi.go.jp/sqras/all/{did}/latest/{z}/{X0}{Y0}/{X1}{Y1}/{X2}{Y2}/{X3}{Y3}/{X4}{Y4}/{X5}{Y5}/{tid}.png', {maxZoom: 18, attribution: '<a tatrget="_blank" href="http://cyberjapan.jp/"><img src="http://cyberjapan.jp/image/logo.gif"/></a>'}); l.getTileUrl = function (e) { this._adjustTilePoint(e); var tid = ('0000000' + e.x).slice(-7) + ('0000000' + e.y).slice(-7); return L.Util.template(this._url, L.Util.extend({ did: { 5: "RELIEF", 6: "RELIEF", 7: "RELIEF", 8: "RELIEF", 9: "BAFD1000K", 10: "BAFD1000K", 11: "BAFD1000K", 12: "BAFD200K", 13: "BAFD200K", 14: "BAFD200K", 15: "DJBMM", 16: "DJBMM", 17: "DJBMM", 18: 'FGD' }[this._getZoomForUrl()], z: this._getZoomForUrl(), x: e.x, y: e.y, tid: tid, X0: tid.charAt(0), X1: tid.charAt(1), X2: tid.charAt(2), X3: tid.charAt(3), X4: tid.charAt(4), X5: tid.charAt(5), X6: tid.charAt(6), Y0: tid.charAt(7), Y1: tid.charAt(8), Y2: tid.charAt(9), Y3: tid.charAt(10), Y4: tid.charAt(11), Y5: tid.charAt(12), Y6: tid.charAt(13), },this.options));} l.addTo(map);
via 電子国土リフ
Modest Maps
MM.MapProvider ããã¿ã¤ã«ã® column, row, zoom ãã URL ãç®åºããé¢æ°ãã³ã³ã¹ãã©ã¯ã¿ã®å¼æ°ã¨ãã¦åã£ã¦ããããæ¯è¼çã¯ãªã¼ã³ãªããæ¹ã§ããã
var layer = new MM.Layer(new MM.MapProvider(function(coord) { var did = [null, null, null, null, null, 'RELIEF', 'RELIEF', 'RELIEF', 'RELIEF', 'BAFD1000K', 'BAFD1000K', 'BAFD1000K', 'BAFD200K', 'BAFD200K', 'BAFD200K', 'DJBMM', 'DJBMM', 'DJBMM', 'FGD'][coord.zoom]; var tid = ('0000000' + coord.column).slice(-7) + ('0000000' + coord.row).slice(-7); var url = 'http://cyberjapandata.gsi.go.jp/sqras/all/' + did + '/latest/' + coord.zoom + '/' + tid.charAt(0) + tid.charAt(7) + '/' + tid.charAt(1) + tid.charAt(8) + '/' + tid.charAt(2) + tid.charAt(9) + '/' + tid.charAt(3) + tid.charAt(10) + '/' + tid.charAt(4) + tid.charAt(11) + '/' + tid.charAt(5) + tid.charAt(12) + '/' + tid + '.png'; return url; }));
via 電子国土MODS
mapbox.js
å®ã¯ããã®ã¬ã¤ã¤ã§ã¯ Modest Maps ããã®ã¾ã¾ã¤ãã£ã¦ããã®ã§ããããã㯠Modest Maps ã¨å ¨ãåãããªããã¡ã½ããã®ä¸ã§ãå®æ°çãªå½¹å²ãæã£ã¦ãã did ã宣è¨ããã®ã¯ã¡ãã£ã¨æ°æã¡æªããJavaScript å¦çç³»ããã¾ããããã ãã¦ãããã¨ããããã©ãã
var layer = new MM.Layer(new MM.MapProvider(function(coord) { var did = [null, null, null, null, null, 'RELIEF', 'RELIEF', 'RELIEF', 'RELIEF', 'BAFD1000K', 'BAFD1000K', 'BAFD1000K', 'BAFD200K', 'BAFD200K', 'BAFD200K', 'DJBMM', 'DJBMM', 'DJBMM', 'FGD'][coord.zoom]; var tid = ('0000000' + coord.column).slice(-7) + ('0000000' + coord.row).slice(-7); var url = 'http://cyberjapandata.gsi.go.jp/sqras/all/' + did + '/latest/' + coord.zoom + '/' + tid.charAt(0) + tid.charAt(7) + '/' + tid.charAt(1) + tid.charAt(8) + '/' + tid.charAt(2) + tid.charAt(9) + '/' + tid.charAt(3) + tid.charAt(10) + '/' + tid.charAt(4) + tid.charAt(11) + '/' + tid.charAt(5) + tid.charAt(12) + '/' + tid + '.png'; return url; }));
via 電子国土MBX