<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>宿迁市交通运输局应急事件处置系统</title>
    <link rel="icon" href="./favicon.ico">
    <script>
        window.spuser = '<%- spuser %>'
    </script>
    <script src="./lib/jquery.js"></script>
    <script src="./lib/md5.js"></script>
    <script src="./lib/jsencrypt.min.js"></script>
    <!-- <script src="./flexible.js"></script> -->
    <script src="./login.js?time=2"></script>
    <script src="./webClient/defaultConfig.js?time=115"></script>
    <script src="./webClient/initWebSocket.js?time=127"></script>
    <script src="./webClient/webClient_initWnd.js?time=1223"></script>



    <!--    <script src="../webClient/defaultConfig.js"></script>-->
    <!--    <script src="../webClient/initWebSocket.js"></script>-->
    <!--    <script src="../webClient/webClient_initWnd.js"></script>-->
    <script src="./js/common.js?time=5"></script>

    <script src="./meeting.js?time=44"></script>
    <script src="./js/videoplay.js?time=3"></script>

    <!-- <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.1/build/g6.js"></script> -->
    <link rel="stylesheet" href="<%- mapurl %>/minemapapi/v2.1.0/minemap.css">
    <script src="<%- mapurl %>/minemapapi/v2.1.0/minemap.js"></script>
    <script src="<%- mapurl %>/minemapapi/v2.1.0/plugins/turf/turf.min.js"></script>
    <script>
        minemap.domainUrl = '<%- mapurl %>';
        minemap.dataDomainUrl = '<%- mapurl %>';
        minemap.serverDomainUrl = '<%- mapurl %>';
        minemap.spriteUrl = '<%- mapurl %>/minemapapi/v2.1.0/sprite/sprite';
        minemap.serviceUrl = '<%- mapurl %>/service/';

        /**
         * key、solution设置
         */

        minemap.key = '<%- mapkey %>';
        minemap.solution = '<%- mapsolution %>';
    </script>


    <!-- <link rel="stylesheet" href="https://minedata.cn/minemapapi/v2.1.0/minemap.css" />
    <script src="https://minedata.cn/minemapapi/v2.1.0/minemap.js"></script>

    <script>
        minemap.domainUrl = 'https://minedata.cn';
        minemap.dataDomainUrl = 'https://minedata.cn';
        minemap.serverDomainUrl = 'https://minedata.cn';
        minemap.spriteUrl = 'https://minedata.cn/minemapapi/v2.1.0/sprite/sprite';
        minemap.serviceUrl = 'https://minedata.cn/service/';

        minemap.key = '77ef70465c2d4888b3a5132523494b94';
        minemap.solution = 16857;
    </script> -->
    <script>
        (function(win, lib) {
            var doc = win.document;
            var docEl = doc.documentElement;
            var metaEl = doc.querySelector('meta[name="viewport"]');
            var flexibleEl = doc.querySelector('meta[name="flexible"]');
            var dpr = 0;
            var scale = 0;
            var tid;

            function detectZoom() {
                let ratio = 0,
                    screen = window.screen,
                    ua = navigator.userAgent.toLowerCase();
                if (window.devicePixelRatio !== undefined) {
                    ratio = window.devicePixelRatio;
                } else if (~ua.indexOf('msie')) {
                    if (screen.deviceXDPI && screen.logicalXDPI) {
                        ratio = screen.deviceXDPI / screen.logicalXDPI;
                    }
                } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
                    ratio = window.outerWidth / window.innerWidth;
                }
                if (ratio) {
                    ratio = Math.round(ratio * 100);
                }
                docEl.style.fontSize = (0.0014 * window.outerWidth + window.outerHeight * 0.328 - 10) + "px";

                return ratio;
            }

            function refreshRem() {
                const m = detectZoom();
                console.log(m, 'MMMMMMMMMMMMMMM')
                    // document.body.style.zoom = 100 / Number(m);
                    // docEl.style.fontSize = (m * 3) + "px";
                if (window.map != undefined) {
                    map.resize();
                }
            }
            // window.onresize = () => {

            //     // refreshRem()
            // }

            win.addEventListener(
                'resize',
                function() {
                    // debugger
                    clearInterval(tid);
                    tid = setInterval(refreshRem, 300);
                },
                false,
            );


            refreshRem();


        })(window, window['lib'] || (window['lib'] = {}));
    </script>
</head>

<body style="position: fixed;background-color: #112692;
    width: 100%;
    height: 100%;">
    <div id="app" style="height: 100%;"></div>
    <script type="module" src="/src/main.ts"></script>
</body>

</html>
