|
3 | 3 | *********************************************************************--> |
4 | 4 | <!DOCTYPE html> |
5 | 5 | <html> |
6 | | - <head> |
7 | | - <meta charset="UTF-8" /> |
8 | | - <title data-i18n="resources.title_componentsPopup_Vue"></title> |
9 | | - <script type="text/javascript" include="vue" src="../js/include-web.js"></script> |
10 | | - <script include="ant-design-vue,iclient-leaflet-vue" src="../../dist/leaflet/include-leaflet.js"></script> |
11 | | - <style> |
12 | | - #main { |
13 | | - margin: 0 auto; |
14 | | - width: 100%; |
15 | | - height: 100%; |
16 | | - } |
17 | | - </style> |
18 | | - </head> |
| 6 | + <head> |
| 7 | + <meta charset="UTF-8" /> |
| 8 | + <title data-i18n="resources.title_componentsPopup_Vue"></title> |
| 9 | + <script type="text/javascript" include="vue" src="../js/include-web.js"></script> |
| 10 | + <script include="ant-design-vue,iclient-leaflet-vue" src="../../dist/leaflet/include-leaflet.js"></script> |
| 11 | + <style> |
| 12 | + #main { |
| 13 | + position: relative; |
| 14 | + margin: 0 auto; |
| 15 | + width: 100%; |
| 16 | + height: 100%; |
| 17 | + } |
| 18 | + .message { |
| 19 | + position: absolute; |
| 20 | + left: 10px; |
| 21 | + top: 10px; |
| 22 | + } |
| 23 | + </style> |
| 24 | + </head> |
19 | 25 |
|
20 | | - <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;"> |
21 | | - <div id="main"> |
22 | | - <sm-web-map server-url="https://iportal.supermap.io/iportal" map-id="1329428269" @click="mapClick"> |
23 | | - <!-- 弹窗组件 --> |
24 | | - <sm-popup> |
25 | | - <a-table :columns="columns" :data-source="data" :pagination="false" /> |
26 | | - </sm-popup> |
27 | | - </sm-web-map> |
28 | | - </div> |
| 26 | + <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;"> |
| 27 | + <div id="main"> |
| 28 | + <sm-web-map server-url="https://iportal.supermap.io/iportal" map-id="1329428269" @click="mapClick"> |
| 29 | + <!-- 弹窗组件 --> |
| 30 | + <sm-popup> |
| 31 | + <a-table :columns="columns" :data-source="data" :pagination="false" /> |
| 32 | + </sm-popup> |
| 33 | + </sm-web-map> |
| 34 | + </div> |
29 | 35 |
|
30 | | - <script> |
31 | | - new Vue({ |
32 | | - el: '#main', |
33 | | - data() { |
34 | | - return { |
35 | | - // table的props |
36 | | - columns: [ |
37 | | - { key: 1, title: '经度', dataIndex: 'lng' }, |
38 | | - { key: 2, title: '纬度', dataIndex: 'lat' } |
39 | | - ], |
40 | | - data: [] |
41 | | - }; |
42 | | - }, |
43 | | - methods: { |
44 | | - mapClick(e) { |
45 | | - let latLng = e.map.layerPointToLatLng(e.mapboxEvent.layerPoint); |
46 | | - this.data = [{ key: 1, lng: latLng.lng.toFixed(2), lat: latLng.lat.toFixed(2) }]; |
47 | | - } |
48 | | - } |
49 | | - }); |
50 | | - </script> |
51 | | - </body> |
| 36 | + <script> |
| 37 | + new Vue({ |
| 38 | + el: '#main', |
| 39 | + data() { |
| 40 | + return { |
| 41 | + // table的props |
| 42 | + columns: [ |
| 43 | + { key: 1, title: '经度', dataIndex: 'lng' }, |
| 44 | + { key: 2, title: '纬度', dataIndex: 'lat' } |
| 45 | + ], |
| 46 | + data: [] |
| 47 | + }; |
| 48 | + }, |
| 49 | + mounted(){ |
| 50 | + this.$message.info(resources.msg_clickToPopup); |
| 51 | + }, |
| 52 | + methods: { |
| 53 | + mapClick(e) { |
| 54 | + let latLng = e.map.layerPointToLatLng(e.mapboxEvent.layerPoint); |
| 55 | + this.data = [{ key: 1, lng: latLng.lng.toFixed(2), lat: latLng.lat.toFixed(2) }]; |
| 56 | + } |
| 57 | + } |
| 58 | + }); |
| 59 | + </script> |
| 60 | + </body> |
52 | 61 | </html> |
0 commit comments