ceshi.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>地图测试页</title>
  6. <style>
  7. html,
  8. body,
  9. .map {
  10. padding: 0;
  11. margin: 0;
  12. height: 100%;
  13. width: 100%;
  14. color: #FFFFFF;
  15. }
  16. </style>
  17. <link rel="stylesheet" href="http://10.101.35.46/arcgis_js_api/library/4.19/esri/themes/light/main.css">
  18. <script src="http://10.101.35.46/arcgis_js_api/library/4.19/init.js"></script>
  19. <script>
  20. require(["esri/Map", "esri/views/SceneView", "esri/views/MapView", "esri/layers/TileLayer", "esri/layers/SceneLayer",
  21. 'esri/geometry/SpatialReference', 'esri/widgets/LayerList', 'esri/widgets/Expand', 'esri/layers/GroupLayer', 'esri/config',
  22. 'esri/layers/FeatureLayer', 'esri/geometry/Point', 'esri/Graphic'],
  23. (Map, SceneView, MapView, TileLayer, SceneLayer, SpatialReference, LayerList, Expand, GroupLayer, esriConfig, FeatureLayer, Point, Graphic) => {
  24. const map = new Map();
  25. const initCamera = {
  26. heading: 0,
  27. tilt: 0.49999999999913347,
  28. fov: 55,
  29. position: {
  30. x: 0,
  31. y: 0,
  32. z: 100000,
  33. spatialReference: SpatialReference.WebMercator
  34. }
  35. }
  36. const sceneView = new SceneView({
  37. container: "viewDiv",
  38. map: map,
  39. camera: initCamera,
  40. popup: {
  41. defaultPopupTemplateEnabled: true
  42. }
  43. });
  44. var layerList = new LayerList({
  45. view: sceneView
  46. })
  47. var layerListExpand = new Expand({
  48. expandTooltip: '图层控制',
  49. view: sceneView,
  50. content: layerList
  51. })
  52. const BuildingLayer = new SceneLayer({
  53. title: '白模',
  54. url: 'http://10.101.35.56/i3s_svc/baimo/SceneServer/layers/0',
  55. });
  56. const feature=new FeatureLayer({
  57. url:"",
  58. visible:true
  59. });
  60. const modelGroupLayer = new GroupLayer({
  61. title: '我的图层',
  62. visible: true,
  63. visibilityMode: 'independent',
  64. layers: [BuildingLayer],
  65. opacity: 1
  66. });
  67. map.add(modelGroupLayer);
  68. map.add(feature);
  69. sceneView.ui.add([layerListExpand], 'top-left');
  70. // })
  71. });
  72. </script>
  73. </head>
  74. <body>
  75. <div id="viewDiv" class="map"></div>
  76. </body>
  77. </html>