Advertisement

使用OpenLayers创建地图界面,并在其中添加鼠标光标显示二维坐标的功能

阅读量:

对小白极其友好,希望这篇文章是刚刚入门看不懂英文官网的小白的一根救命“稻草”

话不多说,先上代码

复制代码
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <!-- 引入openlayers样式 -->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/css/ol.css" type="text/css">
       <!-- 引入openlayers的js -->
        <script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/build/ol.js"></script>
        <title>OpenLayers example</title>
        <style>
            .map {
            //这样地图可以铺满全屏
              positi

全部评论 (0)

还没有任何评论哟~