欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

arcgis for js 的阴影立体效果

最编程 2024-10-02 19:12:48
...
<!DOCTYPE html> <html lang="zn"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Yang的案例</title> <style> body { margin: 0; } #mapview { position: absolute; width: 100%; height: 100%; background: #fff; } </style> <link rel="stylesheet" href="https://js.arcgis.com/4.23/esri/themes/light/main.css" /> <script src="https://js.arcgis.com/4.23/"></script> </head> <body> <div id="mapview"></div> <script> require([ 'esri/Map', 'esri/views/MapView', 'esri/Basemap', 'esri/layers/WebTileLayer', 'esri/layers/GroupLayer', 'esri/layers/GeoJSONLayer', 'esri/layers/VectorTileLayer' ], function (Map, MapView, Basemap, WebTileLayer, GroupLayer, GeoJSONLayer) { // 初始化底图 window.map = new Map({ basemap: 'hybrid' }) // 创建2维视图 let view = new MapView({ container: 'mapview', map: map, zoom: 13, // 初始化级别 center: [103.97992123657217, 30.680738016500914] // 初始化中心点坐标 }) view.when(() => { // 去除原本底图 map.basemap = null // 使用geojson实现 const boundaryLineLayer = new GeoJSONLayer({ url: 'https://geo.datav.aliyun.com/areas_v3/bound/510105.json', effect: 'drop-shadow(0, 8px, 3px, rgba(0,0,0,1))', // effect: 'brightness(150%) drop-shadow(20px, 20px, 10px, #000)', outFields: ['*'], renderer: { type: 'simple', symbol: { type: 'simple-line', color: '#000', width: 1 } } }) map.add(boundaryLineLayer) }) }) </script> </body> </html>