Map.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div id="map">
  3. <iframe id="i_map" name="i_map">
  4. </iframe>
  5. </div>
  6. </template>
  7. <script>
  8. import CityGis from '../../unit/map/CityGis.Bridge.js';
  9. import {myBridge} from "../../unit/map/map.js";
  10. import {useMapStore} from "../../store/mapStore.js";
  11. import {nextTick,ref,onMounted} from "vue";
  12. import {AddSingleLayer, MapClickByType, SetBackground} from "../../unit/map/addLayer.js";
  13. let bridge;
  14. export default {
  15. name: "Map",
  16. setup(){
  17. onMounted(()=>{
  18. myBridge.bridgeContent = bridge = new CityGis.Bridge({
  19. id: "i_map",
  20. // url: 'https://cimweb.zjw.sh.cegn.cn:2007/VUE-Map-Tool-Widget/#/jk_map?theme=dark&type=3D', //建科发布
  21. url: 'http://localhost:8081/#/jk_map?theme=dark&type=3D',
  22. onReady: function () {
  23. console.log("地图创建完成")
  24. }
  25. })
  26. MapClickByType('show');
  27. AddSingleLayer()
  28. })
  29. }
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. #map{
  34. position: absolute;
  35. top: 0;
  36. left: 0;
  37. width: 100%;
  38. height: 100%;
  39. z-index: 1;
  40. }
  41. #i_map {
  42. position: fixed;
  43. width: 100%;
  44. height: 100%;
  45. left: 0;
  46. top: 0;
  47. border: none;
  48. }
  49. </style>