index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. <template>
  2. <div id="viewDiv" class="viewDiv">
  3. <tf-dialog :show.sync="params.tfDialog.Show" :hide.sync="params.tfDialog.Hide" :set-size.sync="params.tfDialog.setSize" />
  4. <el-container style="height: 100%; width: 100%;">
  5. <el-container :style="{ height: 'calc(100% - ' + footer_height + ')', width: '100%' }">
  6. <el-main>
  7. <div id="antherPanel" style="display: none;width: 50%;height: 100%;float: left;border-right: 3px solid #ccc;" />
  8. <!-- 三维视图 -->
  9. <div id="sceneView" ref="sceneView" class="sceneView" v-show="false" :style="{ width: '0'}">
  10. <!-- 23D视图切换 -->
  11. <viewChange />
  12. <measureMent3D v-if="viewer" :viewer="viewer" />
  13. <sceneFly v-if="viewer" :viewer="viewer" />
  14. <!-- 底部状态栏 -->
  15. <viewerStatusBar v-if="viewer" :viewer="viewer"></viewerStatusBar>
  16. </div>
  17. <!-- 二维视图 -->
  18. <div id="mapView" ref="mapView" class="mapView" :style="{ marginRight:'0', height: '100%' }">
  19. <div v-show="labelShow" id="mapLabel">
  20. <img src="./images/mapLabel.png" />
  21. </div>
  22. <div v-show="themShow" id="them" style="position: absolute;left: calc(50% - 250px);top: calc(50% - 150px);">
  23. <img style="width: 500px; height: 300px;" :src="themSrc" />
  24. </div>
  25. <!-- 地图查询 -->
  26. <div class="tofly-map-query">
  27. <MapQueryTool v-if="map" :map="map" />
  28. </div>
  29. <!-- 放大缩小 -->
  30. <MapZoom v-if="map" :map="map" />
  31. <!-- 工具条 -->
  32. <div class="tofly-tools">
  33. <!-- 数据维护 -->
  34. <!-- <div class="tool-item">
  35. <FeatureEdit v-if="map" :map="map" :mapConfig='config'/>
  36. </div> -->
  37. <div class="tool-item">
  38. <LayerControl v-if="map" :map="map" />
  39. </div>
  40. <div class="tool-item">
  41. <MeasureMent v-if="map" :map="map" />
  42. </div>
  43. <div class="tool-item">
  44. <toolBox v-if="map" :map="map" />
  45. </div>
  46. </div>
  47. <!-- 指北针 -->
  48. <MapCompass v-if="map" :map="map" />
  49. <!-- 23D视图切换 -->
  50. <viewChange />
  51. <!-- 默认范围 -->
  52. <div ref="tofly-map-reset" class="tofly-map-resetMap iconfont icon-fang" title="默认范围" @click="ResetMap" />
  53. <!-- 图例 -->
  54. <mapLegend />
  55. <!-- 鹰眼 -->
  56. <div ref="tofly-map-OverviewMap" class="tofly-map-OverviewMap" />
  57. <!-- 比例尺 -->
  58. <div class="tofly-map-ScaleLine">
  59. <span>比例尺:</span>
  60. <div ref="tofly-map-ScaleLine" />
  61. </div>
  62. <!-- 鼠标坐标 -->
  63. <div ref="tofly-map-MousePosition" class="tofly-map-MousePosition" />
  64. <!-- 气泡弹窗 -->
  65. <popupWindow v-if="map" ref="popupWindow" :map="map"></popupWindow>
  66. </div>
  67. <float-panels v-if="this.view" :panels="FloatPanels" :data="params" :panel-visible.sync="floatpanel_visible"
  68. @handelClose="handelClose" />
  69. <right-half-panals v-if="this.view" :panels="RightHalfPanals" :data="params" :panel-visible.sync="rightpanel_visible"
  70. @handelClose="handelClose" />
  71. </el-main>
  72. <el-aside :style="{ width: side_width, height: '100%' }">
  73. <side-panels v-if="this.view" :panels="Panels" :data="params" :side-width.sync="side_width"
  74. :panel-visible.sync="sidepanel_visible" @handelClose="handelClose" />
  75. </el-aside>
  76. </el-container>
  77. <el-footer :style="{ height: footer_height, width: '100%', padding: '0px' }">
  78. <half-panels v-if="this.view" :panels="HalfPanels" :data="params" :footer-height.sync="footer_height"
  79. :default-height="halfpanel_defaultHeight" :panel-visible.sync="halfpanel_visible"
  80. :fullpanel-visible.sync="fullpanel_visible" @handelClose="handelClose" />
  81. <full-panels v-if="this.view" :panels="FullPanels" :data="params" :footer-height.sync="footer_height"
  82. :panel-visible.sync="fullpanel_visible" :halfpanel-visible.sync="halfpanel_visible" @handelClose="handelClose" />
  83. </el-footer>
  84. </el-container>
  85. </div>
  86. </template>
  87. <script>
  88. import Layout from '@/layout';
  89. import 'ol/ol.css';
  90. import Comps from '@/layout/components/loadComps';
  91. import { HalfPanels, FullPanels, FloatPanels, SidePanels, RightHalfPanals } from '@/layout/components/index';
  92. import { esriConfig } from 'staticPub/config';
  93. import { loadCss } from '@/utils/loadResources';
  94. import tfDialog from './common/Dialog';
  95. import { Map, View, Feature, Overlay } from 'ol';
  96. import { Polygon, Point, LineString, MultiLineString } from 'ol/geom';
  97. import { Image as ImageLayer, Vector as VectorLayer, Tile as TileLayer } from 'ol/layer';
  98. import { OSM, XYZ, ImageWMS, Vector as VectorSource } from 'ol/source';
  99. import { Style, Fill, Stroke, Icon, Text, Circle } from 'ol/style';
  100. import { createStringXY } from 'ol/coordinate';
  101. import { unByKey } from 'ol/Observable';
  102. import { OverviewMap, ScaleLine, defaults, MousePosition, FullScreen, Zoom } from 'ol/control';
  103. import MapQueryTool from './mapViewTools/mapQuery';
  104. import { Select, Draw } from 'ol/interaction';
  105. import { altKeyOnly, click, pointerMove } from 'ol/events/condition';
  106. import { mapConfig } from './map.config';
  107. import { getSiteInfoList, getAlarmEventList } from '@/api/oneMap';
  108. import { format } from 'ol/coordinate';
  109. import { bbox as bboxStrategy } from 'ol/loadingstrategy';
  110. import GeoJSON from 'ol/format/GeoJSON';
  111. import { getVectorContext } from 'ol/render';
  112. import * as turf from '@turf/turf'
  113. import { Logo, TileSuperMapRest, SuperMap, FeatureService } from '@supermap/iclient-ol';
  114. // 投影
  115. import { Projection, addProjection, get as getProjection, fromLonLat, transform } from 'ol/proj';
  116. import { register as olRegisterProj } from 'ol/proj/proj4';
  117. import proj4 from 'proj4'
  118. // 基础工具
  119. import MapZoom from '@/views/MapView/mapViewTools/mapZoom';
  120. import MeasureMent from './mapViewTools/measureMent';
  121. import FeatureEdit from './mapViewTools/featureEditTools';
  122. import LayerControl from '@/views/MapView/mapViewTools/layerControl';
  123. import viewToggle from '@/views/MapView/mapViewTools/viewToggle';
  124. import screenShots from '@/views/MapView/mapViewTools/screenShots';
  125. import MapToggle from '@/views/MapView/mapViewTools/basicMapToggle';
  126. import toolBox from '@/views/MapView/mapViewTools/toolBox';
  127. import viewChange from '@/views/MapView/mapViewTools/viewChange';
  128. import measureMent3D from '@/views/MapView/mapViewTools/measureMent3D';
  129. import sceneFly from '@/views/MapView/mapViewTools/sceneFly';
  130. import MapCompass from '@/views/MapView/mapViewTools/mapCompass';
  131. import viewerStatusBar from '@/views/MapView/mapViewTools/viewerStatusBar'
  132. import popupWindow from '@/views/MapView/mapViewTools/popupWindow'
  133. import mapLegend from '@/views/MapView/mapViewTools/mapLegend'
  134. import { getFields } from '@/api/kxc/pipelineSystem'
  135. import { async } from 'q';
  136. const Cesium = window.Cesium; // 获取Cesium
  137. export default {
  138. components: {
  139. HalfPanels,
  140. FullPanels,
  141. FloatPanels,
  142. SidePanels,
  143. RightHalfPanals,
  144. tfDialog,
  145. MapQueryTool,
  146. MapZoom,
  147. MeasureMent,
  148. LayerControl,
  149. viewToggle,
  150. screenShots,
  151. MapToggle,
  152. toolBox,
  153. viewChange,
  154. measureMent3D,
  155. FeatureEdit,
  156. MapCompass,
  157. sceneFly,
  158. viewerStatusBar,
  159. popupWindow,
  160. mapLegend
  161. },
  162. data() {
  163. return {
  164. config: null,
  165. projection: null,
  166. map: null,
  167. layers: [],
  168. monitorLayer: null, // 监测专题图层
  169. viewTileLayers: [],
  170. controls: null,
  171. view: null,
  172. Comps,
  173. show: true,
  174. themShow: false,
  175. themSrc: '',
  176. labelShow: false,
  177. side_width: '0%',
  178. footer_height: '0%',
  179. sidepanel_visible: false,
  180. floatpanel_visible: false,
  181. rightpanel_visible: false,
  182. halfpanel_visible: false,
  183. fullpanel_visible: false,
  184. halfpanel_defaultHeight: '400px',
  185. params: {
  186. mapView: this.view,
  187. that: this,
  188. // 当前激活的模块
  189. activeModel: null,
  190. tfDialog: {
  191. Show: null,
  192. Hide: null,
  193. setSize: null
  194. }
  195. },
  196. // 图例控制
  197. legend: false,
  198. inputInfo: '',
  199. sceneView_visible: true,
  200. viewer: null,
  201. viewChangeStep: 2, // 防止两个视图变化监听死循环
  202. // mapView2D: false
  203. // 点击查询
  204. queryByClick: {
  205. querying: false,
  206. resultInfo: null
  207. },
  208. popupInfo: null // 点击选中的要素
  209. };
  210. },
  211. computed: {
  212. Panels() {
  213. return this.$store.state.map.panels;
  214. },
  215. FullPanels() {
  216. return this.$store.state.map.fullPanels;
  217. },
  218. HalfPanels() {
  219. return this.$store.state.map.halfPanels;
  220. },
  221. FloatPanels() {
  222. return this.$store.state.map.floatPanels;
  223. },
  224. RightHalfPanals() {
  225. return this.$store.state.map.rightHalfPanels;
  226. },
  227. },
  228. watch: {
  229. FullPanels() {
  230. this.show = true;
  231. }
  232. },
  233. created: function () {
  234. },
  235. mounted: function () {
  236. loadCss(esriConfig.baseCssUrl); // 本地css资源
  237. const _this = this;
  238. this.$nextTick(function () {
  239. _this.getProj() // 定义坐标系cgcs2000
  240. _this.initMap();
  241. _this.addIserverLayers()
  242. _this.creatSceneView()
  243. });
  244. this.config = mapConfig;
  245. this.getPipeFields()
  246. // 监听地图容器大小变化,更新地图
  247. this.$erd.listenTo(this.$refs.mapView, element => {
  248. this.map.updateSize();
  249. });
  250. },
  251. methods: {
  252. handelClose() {
  253. this.show = false;
  254. },
  255. getProj() {
  256. proj4.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs");
  257. olRegisterProj(proj4);
  258. this.projection = new Projection({
  259. code: "EPSG:4490",
  260. extent: [-180, -90, 180, 90],
  261. worldExtent: [-180, -90, 180, 90],
  262. units: "degrees"
  263. });
  264. addProjection(this.projection);
  265. },
  266. initMap() {
  267. this.getMap(this.config);
  268. this.getMapTools(this.config);
  269. this.map = new Map({
  270. target: 'mapView',
  271. layers: this.layers,
  272. view: this.view,
  273. controls: this.controls
  274. });
  275. // this.map.on('pointermove', e => {
  276. // var pixel = this.map.getEventPixel(e.originalEvent);
  277. // var hit = this.map.hasFeatureAtPixel(pixel);
  278. // this.map.getTargetElement().style.cursor = hit ? 'pointer' : '';
  279. // });
  280. // 更改鹰眼按钮图标
  281. $('.ol-overviewmap button').addClass('iconfont iconyy');
  282. // 二维地图鼠标拖拽监听
  283. // this.map.on('pointerdrag', evt => {
  284. // if (this.mapView2D == true)
  285. // this.map_extentChangeHandler()
  286. // })
  287. // 二维地图视图改变监听
  288. this.map.on('moveend', evt => {
  289. console.log("地图级别", this.map.getView().getZoom())
  290. this.map_extentChangeHandler()
  291. })
  292. // 地图点击事件,点击查询
  293. this.map.on("click", async event => {
  294. let pipelineDataServer = mapConfig.iServerUrl.pipelineDataServer // 管线数据服务
  295. await this.clickQuery(event.coordinate, pipelineDataServer)
  296. })
  297. },
  298. addIserverLayers() {
  299. // 加载底图
  300. this.loadiServerLayers(this.config.iServerUrl.baseMapLayers)
  301. // 加载公房宗地图层
  302. this.loadiServerLayers(this.config.iServerUrl.publicHouseLayers)
  303. // 加载基础GIS图层
  304. this.loadiServerLayers(this.config.iServerUrl.basicGISLayers)
  305. // 加载管线图层
  306. this.loadiServerLayers(this.config.iServerUrl.pipelineLayers)
  307. },
  308. /**
  309. * 获取地图
  310. **/
  311. getMap(options) {
  312. if (!options) return;
  313. // 获取鹰眼图层
  314. let viewTileLayer = options.iServerUrl.baseMapLayers.filter(item => {
  315. return item.name == '电子地图'
  316. });
  317. if (viewTileLayer.length > 0) {
  318. this.viewTileLayers = [
  319. new TileLayer({
  320. source: new TileSuperMapRest({
  321. url: viewTileLayer[0].url,
  322. crossOrigin: 'anonymous'
  323. })
  324. })
  325. ]
  326. }
  327. this.view = new View({
  328. center: [104.753586, 31.521350],
  329. // projection: this.projection,
  330. projection: "EPSG:4326",
  331. zoom: 15,
  332. maxZoom: 23,
  333. minZoom: 13,
  334. constrainResolution: true
  335. });
  336. this.params.mapView = this.view;
  337. },
  338. /**
  339. * 获取地图工具
  340. **/
  341. getMapTools(options) {
  342. const arrControls = [];
  343. // 添加比例尺
  344. arrControls.push(
  345. new ScaleLine({
  346. units: 'metric',
  347. target: this.$refs['tofly-map-ScaleLine']
  348. })
  349. );
  350. // 添加鼠标位置
  351. arrControls.push(
  352. new MousePosition({
  353. coordinateFormat: coordinate => {
  354. return format(coordinate, '经度:{x} 纬度:{y}', 6);
  355. }, // 保留6位小数位
  356. target: this.$refs['tofly-map-MousePosition']
  357. })
  358. );
  359. // 添加一个鹰眼控件
  360. arrControls.push(
  361. new OverviewMap({
  362. target: this.$refs['tofly-map-OverviewMap'],
  363. layers: this.viewTileLayers,
  364. collapseLabel: '',
  365. label: '',
  366. collapsed: false,
  367. tipLabel: '鹰眼'
  368. })
  369. );
  370. if (arrControls && arrControls.length > 0) {
  371. this.controls = defaults({
  372. attribution: false,
  373. zoom: false,
  374. rotate: false
  375. }).extend(arrControls);
  376. }
  377. },
  378. /**
  379. * 地图复位
  380. */
  381. ResetMap() {
  382. // 重置中心点位置为初始化位置
  383. this.view.setZoom(15);
  384. this.view.animate({
  385. center: [104.753586, 31.521350],
  386. duration: 600
  387. });
  388. },
  389. /**
  390. * 加载iserver服务图层
  391. */
  392. loadiServerLayers(LAYERS) {
  393. LAYERS.forEach(item => {
  394. this.map.addLayer(new TileLayer({
  395. source: new TileSuperMapRest({
  396. url: item.url,
  397. wrapX: true,
  398. crossOrigin: 'anonymous'
  399. }),
  400. name: item.name,
  401. type: item.type,
  402. visible: item.visible
  403. }))
  404. })
  405. },
  406. /**
  407. * 初始化三维场景
  408. */
  409. creatSceneView() {
  410. this.viewer = new Cesium.Viewer("sceneView", {
  411. imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
  412. url: 'http://t0.tianditu.gov.cn/img\_w/wmts?tk=700ea8c1e2dd873c349dc880169fd96d',
  413. layer: 'img',
  414. style: 'default',
  415. tileMatrixSetID: 'w',
  416. format: 'tiles',
  417. maximumLevel: 18
  418. }),
  419. infoBox: false
  420. });
  421. /**
  422. * 三维相机变化监听
  423. */
  424. this.viewer.scene.camera.moveEnd.addEventListener(() => {
  425. //实现对应的移动结束操作
  426. // console.log("相机移动", this.viewer.camera.computeViewRectangle(), this.map.getView().calculateExtent(this.map.getSize()))
  427. // if (this.mapView2D == true) return false
  428. this.viewChangeStep--
  429. if (this.viewChangeStep === 1) {
  430. const cameraExtent = this.viewer.camera.computeViewRectangle()
  431. let viewExtent = [
  432. cameraExtent.west * (180 / Math.PI),
  433. cameraExtent.south * (180 / Math.PI),
  434. cameraExtent.east * (180 / Math.PI),
  435. cameraExtent.north * (180 / Math.PI)
  436. ]
  437. this.map.getView().fit(viewExtent, this.map.getSize(), { duration: 1000 })
  438. }
  439. else
  440. this.viewChangeStep = 2
  441. })
  442. // 加载三维图层
  443. let s3mArray = this.config.iServerUrl.sceneService
  444. s3mArray.forEach(item => {
  445. this.viewer.scene.addS3MTilesLayerByScp(item.url, { name: item.name })
  446. });
  447. this.config.iServerUrl.tiles3D.forEach(item => {
  448. this.viewer.scene.open(item)
  449. })
  450. },
  451. /**
  452. * 视图联动二维地图变化
  453. */
  454. map_extentChangeHandler() {
  455. this.viewChangeStep--;
  456. if (this.viewChangeStep === 1) {
  457. let viewExtent = this.map.getView().calculateExtent(this.map.getSize())
  458. this.viewer.camera.setView({
  459. destination: Cesium.Rectangle.fromDegrees(viewExtent[0], viewExtent[1], viewExtent[2], viewExtent[3]),
  460. })
  461. } else {
  462. this.viewChangeStep = 2
  463. }
  464. },
  465. /**
  466. * 点击查询功能,在所有的数据集中查询
  467. */
  468. async clickQuery(position, DataServer) {
  469. this.queryByClick.querying = true // 开始点击查询
  470. console.log('地图点击查询开始')
  471. document.getElementById('mapView').style = "cursor:wait"
  472. let zoom = this.map.getView().getZoom()
  473. // 地图小于15级停止请求服务器查询
  474. if (zoom <= 15) {
  475. document.getElementById('mapView').style = "cursor:default"
  476. this.popupWindowClose()
  477. setTimeout(() => {
  478. this.queryByClick.querying = false
  479. console.log('小比例尺,地图点击查询结束')
  480. }, 500);
  481. return false;
  482. }
  483. let dis = 60 / 100000 // 缓冲距离
  484. if (zoom > 15) dis = 25 / 10000
  485. if (zoom >= 17) dis = 12 / 10000
  486. if (zoom >= 20) dis = 5 / 10000
  487. if (zoom >= 23) dis = 3 / 10000
  488. let bufferPoint = turf.buffer(turf.point(position), dis, { units: 'kilometers' }) // 缓冲
  489. console.log("级别:", zoom, "缓冲:", dis * 1000)
  490. let resultArray = []
  491. for (let i = 0; i < DataServer.dataSetInfo.length; i++) {
  492. // 空间查询参数
  493. let geometryParam = new SuperMap.GetFeaturesByGeometryParameters({
  494. toIndex: -1,
  495. maxFeatures: 10,
  496. datasetNames: [DataServer.dataSource + ':' + DataServer.dataSetInfo[i].name],
  497. geometry: new GeoJSON().readFeature(bufferPoint).getGeometry(),
  498. spatialQueryMode: "INTERSECT" // 相交空间查询模式
  499. })
  500. await this.doClickQuery(DataServer.url, geometryParam).then(res => {
  501. if (res && res.result.features.features.length > 0) {
  502. let feature = res.result.features.features[0]
  503. feature["dataType"] = DataServer.dataSetInfo[i]
  504. if (feature.dataType.type == "line")
  505. resultArray.push(feature)
  506. else if (feature.dataType.type == "point")
  507. resultArray.unshift(feature)
  508. }
  509. })
  510. }
  511. if (resultArray.length > 0) {
  512. // 选择第一个作为结果
  513. this.popupWindowShow(position, resultArray[0])
  514. }
  515. else this.popupWindowClose()
  516. document.getElementById('mapView').style = "cursor:default"
  517. this.queryByClick.querying = false // 结束点击查询
  518. console.log('地图点击查询结束!!')
  519. },
  520. /**
  521. * 执行点击查询
  522. */
  523. doClickQuery(url, geometryParam) {
  524. return new Promise((resolve) => {
  525. //向服务器发送请求,并对返回的结果进行处理
  526. new FeatureService(url).getFeaturesByGeometry(geometryParam, serviceResult => {
  527. if (serviceResult.type == "processFailed") {
  528. resolve(null);
  529. }
  530. else {
  531. resolve(serviceResult);
  532. }
  533. })
  534. });
  535. },
  536. /**弹窗显示 */
  537. popupWindowShow(position, feature) {
  538. this.$refs.popupWindow.showPopup(position, feature)
  539. this.queryByClick.resultInfo = { coordinate: position, feature: feature }
  540. this.popupInfo = { coordinate: position, feature: feature }
  541. },
  542. /**弹窗关闭 */
  543. popupWindowClose() {
  544. this.$refs.popupWindow.closePopup()
  545. this.queryByClick.resultInfo = null
  546. this.popupInfo = null
  547. },
  548. /**获取管线的中文字段存放在本地 */
  549. getPipeFields() {
  550. getFields(1).then(res => { this.$store.dispatch('common/setPipeLineFields', res.result) })// 获取管线字段名称
  551. getFields(2).then(res => { this.$store.dispatch('common/setPipePointFields', res.result) })// 获取管点字段名称
  552. getFields(3).then(res => { this.$store.dispatch('common/setGroundFields', res.result) })// 获取管点字段名称
  553. getFields(4).then(res => { this.$store.dispatch('common/setBuildingFields', res.result) })// 获取管点字段名称
  554. }
  555. }
  556. };
  557. </script>
  558. <style lang="scss" scoped>
  559. .viewDiv {
  560. position: absolute;
  561. margin: 0px auto;
  562. width: calc(100% - 0px);
  563. height: calc(100% - 40px);
  564. .el-main {
  565. padding: 0px;
  566. overflow: hidden;
  567. *zoom: 1;
  568. }
  569. .sceneView {
  570. position: relative;
  571. float: right;
  572. height: 100%;
  573. background-color: #fffff2;
  574. }
  575. .mapView {
  576. position: relative;
  577. background-color: #fffff2;
  578. height: 100%;
  579. .tofly-Tool-mapControl {
  580. position: absolute;
  581. width: 350px;
  582. height: 400px;
  583. z-index: 333;
  584. background-color: rgba(255, 255, 255, 0.9);
  585. right: 12px;
  586. top: 52px;
  587. border-radius: 4px;
  588. border: 1px solid #e2e2e2;
  589. }
  590. .tofly-map-query {
  591. position: absolute;
  592. width: auto;
  593. height: 40px;
  594. z-index: 3;
  595. top: 10px;
  596. left: 15px;
  597. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  598. // opacity: 0.9;
  599. }
  600. .tofly-map-ScaleLine {
  601. position: absolute;
  602. width: 300px;
  603. color: #000;
  604. height: 35px;
  605. z-index: 333;
  606. bottom: 0;
  607. left: 80px;
  608. > span {
  609. height: 35px;
  610. line-height: 35px;
  611. }
  612. >>> .ol-scale-line {
  613. background: transparent;
  614. margin-left: 60px;
  615. height: 100%;
  616. bottom: 0;
  617. .ol-scale-line-inner {
  618. border-width: 2px;
  619. border-color: #000;
  620. color: #000;
  621. margin-top: 8px;
  622. }
  623. }
  624. }
  625. .tofly-map-resetMap {
  626. position: absolute;
  627. background-color: rgb(255, 255, 255);
  628. border-radius: 2px;
  629. color: #444444;
  630. width: 32px;
  631. height: 32px;
  632. line-height: 32px;
  633. font-weight: 600;
  634. text-align: center;
  635. right: 15px;
  636. z-index: 333;
  637. bottom: 178px;
  638. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  639. cursor: pointer;
  640. &:hover {
  641. color: #006eb8;
  642. }
  643. }
  644. .tofly-tools {
  645. position: absolute;
  646. top: 10px;
  647. right: 15px;
  648. width: auto;
  649. padding: 0 10px;
  650. height: 40px;
  651. line-height: 40px;
  652. background-color: rgb(255, 255, 255);
  653. z-index: 333;
  654. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  655. // border-radius: 4px;
  656. .tool-item {
  657. display: inline-block;
  658. vertical-align: middle;
  659. padding: 0 10px;
  660. cursor: pointer;
  661. // background-color: rgba(255, 255, 255, 0.9);
  662. }
  663. }
  664. .tofly-map-MousePosition {
  665. position: absolute;
  666. width: 400px;
  667. height: 35px;
  668. z-index: 333;
  669. bottom: 0;
  670. // right: 460px;
  671. left: 200px;
  672. color: #000;
  673. // font-weight: 600;
  674. }
  675. .tofly-map-OverviewMap {
  676. position: absolute;
  677. z-index: 333;
  678. width: 32px;
  679. height: 32px;
  680. bottom: 35px;
  681. right: 15px;
  682. background-color: #fff;
  683. cursor: pointer;
  684. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
  685. >>> .ol-overviewmap {
  686. background-color: #fff !important;
  687. left: unset !important;
  688. right: 40px !important;
  689. bottom: 0.1px !important;
  690. border-radius: 2px;
  691. button {
  692. cursor: pointer;
  693. &:hover {
  694. color: #006eb8;
  695. }
  696. }
  697. }
  698. >>> .ol-overviewmap .ol-overviewmap-map {
  699. height: 200px;
  700. width: 300px;
  701. }
  702. >>> .ol-overviewmap button {
  703. // display: none;
  704. background-color: #fff;
  705. color: #444444;
  706. border-radius: 2px;
  707. outline: none;
  708. }
  709. >>> .ol-overviewmap button {
  710. left: unset !important;
  711. bottom: 4px;
  712. right: -36px;
  713. position: absolute;
  714. }
  715. }
  716. .bottom-contant {
  717. position: absolute;
  718. bottom: 0;
  719. width: 100%;
  720. height: 40px;
  721. background-color: rgba(27, 27, 27, 0.7);
  722. z-index: 333;
  723. }
  724. #mapLabel {
  725. position: absolute;
  726. z-index: 333;
  727. bottom: 0;
  728. }
  729. }
  730. .ol-overlay-container {
  731. span {
  732. display: block;
  733. width: 20px;
  734. height: 42px;
  735. border-radius: 50%;
  736. background: url('/images/rhkSelect.gif') no-repeat;
  737. background-size: 20px 42px;
  738. border: 1px red solid;
  739. }
  740. }
  741. }
  742. .tofly-overviewmap {
  743. right: 100px;
  744. }
  745. .close {
  746. position: absolute;
  747. right: 0;
  748. cursor: pointer;
  749. }
  750. </style>