第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

openlayers加載titleGrid

標(biāo)簽:
JavaScript
<!DOCTYPE html>
<html>
<head>
    <title>Canvas Tiles</title>
    <link rel="stylesheet"  type="text/css">
    <!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
    <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
    <script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="https://openlayers.org/en/v4.5.0/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
    var oUrl="http://10.24.171.34/MERSI/20171116/"+"{z}/{x}/{y}.jpg";
    var layer=new ol.source.TileImage({
        projection: 'EPSG:4326',
        tileGrid: new ol.tilegrid.TileGrid({
            origin: ol.extent.getBottomLeft(new ol.proj.get("EPSG:4326").getExtent()),    // 设置原点坐标
            resolutions:[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125,0.01953125, 0.009765625, 0.0048828125, 0.00244140625],
            extent: [-180, -90, 180, 90],
            tileSize:[256,256],
        }),
        wrapX:false,
        tileUrlFunction:function(tileCoord, pixelRatio, projection) {
            var z = tileCoord[0];
            var x = tileCoord[1];
            /*var y = Math.pow(2, z) + tileCoord[2];*/
            var y = tileCoord[2];
            // wrap the world on the X axis
            var n = Math.pow(2, z + 1); // 2 tiles at z=0
            x = x % n;
            if (x * n < 0) {
                // x and n differ in sign so add n to wrap the result
                // to the correct sign
                x = x + n;
            }
            return oUrl.replace('{z}', z.toString())
                .replace('{y}', y.toString())
                .replace('{x}', x.toString());
        },
    })
    var map = new ol.Map({
        layers: [
            //osmSource,
            /*new ol.layer.Tile({
                source: osmSource
            }),*/
            new ol.layer.Tile({
                source: layer
            }),
            new ol.layer.Tile({
                source: new ol.source.TileDebug({
                    projection: 'EPSG:4326',
                    tileGrid: layer.getTileGrid()
                })
            })

        ],
        target: 'map',
        controls: ol.control.defaults({
            attribution: false,
        }).extend([
            new ol.control.FullScreen(), //全屏
            new ol.control.MousePosition({
                undefinedHTML: 'outside',
                projection: 'EPSG:4326',
                coordinateFormat: function(coordinate) {
                    return ol.coordinate.format(coordinate, '{x}, {y}', 5);
                }
            }), //经纬度坐标
            /*new ol.control.OverviewMap(),*/ //鸟瞰图
            new ol.control.ScaleLine(), // 比例尺
            new ol.control.ZoomSlider(), //滚动轴
            new ol.control.ZoomToExtent(), //回到最大
        ]),
        view: new ol.View({
            projection: 'EPSG:4326',
            center: [116, 39],
            zoom: 4,
            minZoom: 0,
            maxZoom: 8,
            resolutions:[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125,0.01953125, 0.009765625, 0.0048828125, 0.00244140625], //设置分辨率
            extent: [-180, -90, 180, 90]
        })
    });
</script>
</body>
</html>
點(diǎn)擊查看更多內(nèi)容
1人點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消