1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>地图测试页</title>
- <style>
- html,
- body,
- .map {
- padding: 0;
- margin: 0;
- height: 100%;
- width: 100%;
- color: #FFFFFF;
- }
- </style>
- <link rel="stylesheet" href="http://10.101.35.46/arcgis_js_api/library/4.19/esri/themes/light/main.css">
- <script src="http://10.101.35.46/arcgis_js_api/library/4.19/init.js"></script>
- <script>
- require(["esri/Map", "esri/views/SceneView", "esri/views/MapView", "esri/layers/TileLayer", "esri/layers/SceneLayer",
- 'esri/geometry/SpatialReference', 'esri/widgets/LayerList', 'esri/widgets/Expand', 'esri/layers/GroupLayer', 'esri/config',
- 'esri/layers/FeatureLayer', 'esri/geometry/Point', 'esri/Graphic'],
- (Map, SceneView, MapView, TileLayer, SceneLayer, SpatialReference, LayerList, Expand, GroupLayer, esriConfig, FeatureLayer, Point, Graphic) => {
- const map = new Map();
- const initCamera = {
- heading: 0,
- tilt: 0.49999999999913347,
- fov: 55,
- position: {
- x: 0,
- y: 0,
- z: 100000,
- spatialReference: SpatialReference.WebMercator
- }
- }
- const sceneView = new SceneView({
- container: "viewDiv",
- map: map,
- camera: initCamera,
- popup: {
- defaultPopupTemplateEnabled: true
- }
- });
- var layerList = new LayerList({
- view: sceneView
- })
- var layerListExpand = new Expand({
- expandTooltip: '图层控制',
- view: sceneView,
- content: layerList
- })
- const BuildingLayer = new SceneLayer({
- title: '白模',
- url: 'http://10.101.35.56/i3s_svc/baimo/SceneServer/layers/0',
- });
- const feature=new FeatureLayer({
- url:"",
- visible:true
- });
- const modelGroupLayer = new GroupLayer({
- title: '我的图层',
- visible: true,
- visibilityMode: 'independent',
- layers: [BuildingLayer],
- opacity: 1
- });
- map.add(modelGroupLayer);
- map.add(feature);
- sceneView.ui.add([layerListExpand], 'top-left');
- // })
- });
- </script>
- </head>
- <body>
- <div id="viewDiv" class="map"></div>
- </body>
- </html>
|