openlayer本地部署、在线部署

目录

在线部署

本地部署


在线部署

最新版:OpenLayers - Get the Codehttps://openlayers.org/download/ 由于官方的不稳定,速度有时很慢 ,现自己下载部署

将dist/ol.js和ol.css上传到oss中

 访问:

    <script src="http://file.ljgis.com/ol@v7.3.0/dist/ol.js"></script>
    <link rel="stylesheet" href="http://file.ljgis.com/ol@v7.3.0/ol.css">

测试:

 实现代码:

<!DOCTYPE html>
<html lang="en">

<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>ol</title>
    <script src="http://file.ljgis.com/ol@v7.3.0/dist/ol.js"></script>
    <link rel="stylesheet" href="http://file.ljgis.com/ol@v7.3.0/ol.css">
</head>

<body>
    <div id="map" style="width:100%;height:98vh;"></div>
    <script>
        window.onload = function () {
            new ol.Map({
                target: 'map',
                layers: [
                    new ol.layer.Tile({
                        source: new ol.source.OSM()
                    })
                ],
                view: new ol.View({
                    projection: "EPSG:4326",
                    center: [108.522097, 37.272848],
                    zoom: 4.7,
                })
            });
        }
    </script>
</body>

</html>

本地部署

见:Apache和IIS中本地部署openlayers_openlayers apache_疆~的博客-CSDN博客openlayer官网:https://openlayers.org/当前示例中openlayer版本为6.13.0下载openlayers安装包:https://github.com/openlayers/openlayersApache中部署openlayersApache下载安装参考:https://blog.csdn.net/qq_40323256/article/details/123038064启动Apache服务。当前Apache端口为8088IIS中部署ope..https://blog.csdn.net/qq_40323256/article/details/123510446 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值