arcgis for js 4.x 在线简单调用

基于原生js,jQuery的加载方式,

前提需要了解在线官方api:

https://developers.arcgis.com/javascript/latest/

简单调用代码:

复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>加载地图</title>
    <link
      rel="stylesheet"
      href="https://js.arcgis.com/4.23/esri/themes/light/main.css"
    />
    <script src="https://js.arcgis.com/4.23/"></script>
    <style>
        html,
        body,
        #map {
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
        }
    </style>
    <script>
        require(["esri/Map",
            "esri/views/MapView",        
            "dojo/domReady!"
        ], function (Map, MapView) {     
            
            var map = new Map({
                basemap: 'gray-vector'
            });
            var view = new MapView({
                container: "view",
                map: map 
            });                    
            
        })
    </script>
</head>

<body>
    <div id="view"></div>
</body>

</html>
View Code
复制代码

 

posted @   小鱼写代码的过往  阅读(96)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示