缩放因不同浏览器中的传单而异

时间:2017-03-01 16:02:06

标签: javascript css cross-browser leaflet

我一直在使用传单的网站上工作,在Windows中使用Chrome进行测试。我发现当我在其他浏览器中查看它时(特别是MacOS上的Firefox或Chrome,Windows中的IE,Android上的Chrome),缩放是不同的:效果与缩放到125%相同,使缩放在地图的工作方式不同,但也使所有文本等显得有些模糊。如果我在IE上将浏览器缩放更改为75%,它看起来与Chrome版本相同。 Here's a screenshot with side-by-side comparison

这是产生此问题的代码的简化版本:



router.post('/writeFiles', function (req, res, next) {
    console.log("router.post writeFiles");
    var dir = req.body.dir, files = req.body.files;
    var fs = require('fs');
    files.forEach(function (file) {
        fs.writeFile(dir + file.name, file.body, function (err) {
            if (err) return console.log(err);
            console.log(dir + file.name + " is written");
        })
    });
    console.log("All files have been successfully written");
    return res.json(dir);
})






<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
        <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
        <script>
            
        </script>
        <link rel="stylesheet" href="styles_dark.css" />
    </head>
    <body>
        <div id="mapdiv"></div>
        <script>
            // settings
            var northWestCorner=L.latLng(53.85,-5.48),
                southEastCorner=L.latLng(51.03,-2.44),
                mapBounds=L.latLngBounds(northWestCorner,southEastCorner);
            var mainMap = L.map('mapdiv', {
                maxBounds:mapBounds,
                minZoom:8,
                maxZoom:13
            }).setView([52.16, -3.65], 9);
            
            // create map
            L.tileLayer('http://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
            }).addTo(mainMap);
            
        
            
            
        </script>
    </body>
</html>
&#13;
&#13;
&#13;

知道为什么会这样吗?

非常感谢!

0 个答案:

没有答案