ArcGIS API for JavaScript 学习(一) 创建三维地图

创建三维地图。

参考网址:https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/index.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>三维地图</title>
    <style>
        html, body, #viewDiv {
            padding: 0;
            margin: 60px;
            height: 90%;
            width: 90%;
        }
    </style>
    <link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
    <script src="https://js.arcgis.com/4.6/"></script>
    <script>
        require([
            "esri/Map",
            "esri/views/SceneView",
            "dojo/domReady!"
        ], function(Map, SceneView){
            var map = new Map({
                basemap: "streets",
                ground: "world-elevation"
            });
            var view = new SceneView({
                container: "viewDiv",     // Reference to the scene div created in step 5
                map: map,                 // Reference to the map object created before the scene
                scale: 50000000,          // Sets the initial scale to 1:50,000,000
                center: [108.95, 34.53]  // Sets the center point of view with lon/lat
            });
        });
    </script>
</head>
<body>
<div id="viewDiv"></div>
<div style="left: 600px; position: absolute; top: 60px;"><font size="8" color="#00bfff"  >三维地图</font></div>
</body>
</html>
效果如图:


猜你喜欢

转载自blog.csdn.net/x_cosmic/article/details/79977873