arcgis for js 4.x 線上簡單呼叫
阿新 • • 發佈:2022-03-28
基於原生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"View Codecontent="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>