欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ArcGis 初使用

程序员文章站 2023-12-26 15:48:45
...
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>arcGIS</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://js.arcgis.com/4.8/esri/css/main.css">
    <script src="main.js"></script>
    <style>
        html, body, #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="viewDiv"></div>
</body>
<script src="https://js.arcgis.com/4.8/"></script>
<script>
    require([
      "esri/Map",
      "esri/views/MapView",
      'esri/layers/TileLayer',
      'esri/layers/GraphicsLayer',
      "dojo/domReady!"
    ], function(Map, MapView, TileLayer, GraphicsLayer) {
      // Code to create the map and view will go here
        var map = new Map({
            basemap: "streets"  //显示到街道
        });
        var view = new MapView({
            container: "viewDiv",  
            map: map,
            zoom: 15,  
            center: [106.58438, 29.565226], // 地图初始中心点
        });
        // 把China的地图贴在gis地图上
        var myTiledMapServiceLayer = new TileLayer('https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer');
        map.add(myTiledMapServiceLayer); 
        var gsmLayer = new GraphicsLayer();
        map.add(gsmLayer);
    });
</script>
</html>

 

相关标签: ArcGis

上一篇:

下一篇: