1. 程式人生 > 其它 >arcgis for js 4.x 線上簡單呼叫

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