消防点位坐标地图
parent
613ddee17b
commit
89cb569c4b
|
@ -16,6 +16,13 @@ module.exports = {
|
|||
pathRewrite: {
|
||||
'^/api': ''
|
||||
}
|
||||
},
|
||||
'/mapapi/': {
|
||||
target: 'http://192.168.192.215:8021/',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/mapapi/': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
</el-form>
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogFormMap" title="定位" width="1050px" class="dy-dialog">
|
||||
<div id="map"/>
|
||||
<div id="cesiumContainer"/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<span>经度:</span>
|
||||
<el-input v-model="LONGTITUDE" style="width: 200px" placeholder="请输入内容" disabled/>
|
||||
|
@ -167,6 +167,16 @@ import { upload } from '@/utils/upload'
|
|||
import SelectTree from '@/components/SelectTree'
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
import TiandiMap from '@/components/TianMap/TiandiMap.vue'
|
||||
import DragEntity from '../../../map/js/dragentity'
|
||||
import RyDragEntity from '../../../map/js/ry_dragentity'
|
||||
|
||||
let viewer = null
|
||||
let drag = null
|
||||
let ry_drag = null
|
||||
var tiandituTk = 'e8a16137fd226a62a23cc7ba5c9c78ce'
|
||||
var subdomains = ['0', '1', '2', '3', '4', '5', '6', '7']
|
||||
const Cesium = window.Cesium
|
||||
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWQ0MGYwMy0yODUwLTQ1YzktOGM4OC02MTMwY2UyZjNlMzQiLCJpZCI6MTY0NTUwLCJpYXQiOjE2OTM4OTU1Mjd9.1cC0sSzyj79LZv0ILNCcl0Mabw6hl8TNngFNFr7H8f4'
|
||||
|
||||
export default {
|
||||
components: { Pagination, SelectTree, TiandiMap },
|
||||
|
@ -292,7 +302,94 @@ export default {
|
|||
// this.getFirePointCheckPhotos(this.FIRE_POINT_ID)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initCorpInfo()
|
||||
},
|
||||
methods: {
|
||||
initCorpInfo() {
|
||||
requestFN(
|
||||
'/map/getCorpInfo', {}
|
||||
).then((data) => {
|
||||
// this.corpInfo.CORP_INFO_ID = data.info.CORP_INFO_ID
|
||||
// this.corpInfo.latitude = data.info.latitude
|
||||
// this.corpInfo.longitude = data.info.longitude
|
||||
this.initMap2()
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
initMap2() {
|
||||
viewer = new Cesium.Viewer('cesiumContainer', {
|
||||
animation: false, // 动画
|
||||
homeButton: true, // home键
|
||||
geocoder: true, // 地址编码
|
||||
baseLayerPicker: false, // 图层选择控件
|
||||
timeline: false, // 时间轴
|
||||
fullscreenButton: true, // 全屏显示
|
||||
infoBox: true, // 点击要素之后浮窗
|
||||
sceneModePicker: true, // 投影方式 三维/二维
|
||||
navigationInstructionsInitiallyVisible: false, // 导航指令
|
||||
navigationHelpButton: false, // 帮助信息
|
||||
selectionIndicator: false, // 选择
|
||||
imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
|
||||
// 影像底图
|
||||
url: 'http://t{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=' + tiandituTk,
|
||||
subdomains: subdomains,
|
||||
layer: 'tdtImgLayer',
|
||||
style: 'default',
|
||||
format: 'image/jpeg',
|
||||
tileMatrixSetID: 'GoogleMapsCompatible', // 使用谷歌的瓦片切片方式
|
||||
show: true
|
||||
})
|
||||
})
|
||||
|
||||
viewer._cesiumWidget._creditContainer.style.display = 'none' // 隐藏cesium ion
|
||||
viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider({
|
||||
// 影像注记
|
||||
url: 'http://t{s}.tianditu.com/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=' + tiandituTk,
|
||||
subdomains: subdomains,
|
||||
layer: 'tdtCiaLayer',
|
||||
style: 'default',
|
||||
format: 'image/jpeg',
|
||||
tileMatrixSetID: 'GoogleMapsCompatible',
|
||||
show: true
|
||||
}))
|
||||
|
||||
drag = new DragEntity({
|
||||
viewer
|
||||
})
|
||||
// 根据不同的公司将信息加载到地图上
|
||||
// this.initInfo()
|
||||
// this.leftDownAction()
|
||||
// this.dragAreaEntity(this.initPoint)
|
||||
this.loadTilesetHandler()
|
||||
ry_drag = new RyDragEntity({
|
||||
viewer
|
||||
})
|
||||
},
|
||||
loadTilesetHandler() {
|
||||
console.log('loadTilesetHandler')
|
||||
Cesium.ExperimentalFeatures.enableModelExperimental = true
|
||||
var cfdd = new Cesium.Cesium3DTileset({
|
||||
url: '/mapapi/ware/upload/%E6%9B%B9%E5%A6%83%E7%94%B8%E6%B8%AF%E4%B8%9C/%E6%9B%B9%E5%A6%83%E7%94%B8%E6%B8%AF%E4%B8%9C/merge_tile.json'
|
||||
})
|
||||
viewer.scene.primitives.add(cfdd)
|
||||
|
||||
var cfdx = new Cesium.Cesium3DTileset({
|
||||
url: '/mapapi/ware/upload/%E6%9B%B9%E5%A6%83%E7%94%B8%E6%B8%AF%E8%A5%BF/%E6%9B%B9%E5%A6%83%E7%94%B8%E6%B8%AF%E8%A5%BF/merge_tile.json'
|
||||
})
|
||||
viewer.scene.primitives.add(cfdx)
|
||||
|
||||
var qhdxys = new Cesium.Cesium3DTileset({
|
||||
url: '/mapapi/ware/upload/qhdxys/merge_tile.json'
|
||||
})
|
||||
viewer.scene.primitives.add(qhdxys)
|
||||
|
||||
var qhdgysh = new Cesium.Cesium3DTileset({
|
||||
url: '/mapapi/ware/upload/qhdgysh/merge_tile.json'
|
||||
})
|
||||
viewer.scene.primitives.add(qhdgysh)
|
||||
},
|
||||
handleRemove(file) {
|
||||
if (file.IMGFILES_ID) {
|
||||
// 已经上传过的 现在删除 记录这个id
|
||||
|
@ -395,7 +492,8 @@ export default {
|
|||
*/
|
||||
initMap(lng, lat, zoom) {
|
||||
this.initTDT().then((T) => {
|
||||
const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
|
||||
// const imageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' + 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles' + '&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e8a16137fd226a62a23cc7ba5c9c78ce'
|
||||
const imageURL = 'http://t{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=' + tiandituTk
|
||||
// 创建自定义图层对象
|
||||
this.lay = new window.T.TileLayer(imageURL, { minZoom: 1, maxZoom: 18 })
|
||||
// 初始化地图对象
|
||||
|
@ -670,7 +768,7 @@ export default {
|
|||
</script>
|
||||
|
||||
<style>
|
||||
#map {
|
||||
#cesiumContainer {
|
||||
width: 1000px;
|
||||
height: 500px;
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<title>hello-jsmap</title>
|
||||
<script src="http://192.168.0.31:8089/joysuch/jsmap/jsmap.js" type="text/javascript"></script>
|
||||
<link type="text/css" href="http://192.168.0.31:8089/joysuch/jsmap/jsmap.css" rel="stylesheet"/>
|
||||
<script src="http://192.168.192.201:7024/joysuch/jsmap/jsmap.js" type="text/javascript"></script>
|
||||
<link type="text/css" href="http://192.168.192.201:7024/joysuch/jsmap/jsmap.css" rel="stylesheet"/>
|
||||
<!-- <script src="http://mapdemo.joysuch.com/lib/jsmap/jsmap.js" type="text/javascript"></script>-->
|
||||
<!-- <link type="text/css" href="http://mapdemo.joysuch.com/lib/jsmap/jsmap.css" rel="stylesheet"/>-->
|
||||
<link rel="stylesheet" href="http://192.168.0.31:8089/joysuch/LocalAssets/css/animation/pop.css">
|
||||
<link rel="stylesheet" href="http://192.168.0.31:8089/joysuch/LocalAssets/css/animation/loading.css">
|
||||
<link rel="stylesheet" href="http://192.168.0.31:8089/joysuch/LocalAssets/css/dom.css">
|
||||
<link rel="stylesheet" href="http://192.168.192.201:7024/joysuch/LocalAssets/css/animation/pop.css">
|
||||
<link rel="stylesheet" href="http://192.168.192.201:7024/joysuch/LocalAssets/css/animation/loading.css">
|
||||
<link rel="stylesheet" href="http://192.168.192.201:7024/joysuch/LocalAssets/css/dom.css">
|
||||
<style>
|
||||
.jsmap-animation-point,
|
||||
.jsmap-animation-point:after,
|
||||
|
@ -366,7 +366,7 @@
|
|||
mapType: jsmap.JSMapType.MAP_3D,
|
||||
//必要,地图路径
|
||||
// mapServerURL: 'http://mapdemo.joysuch.com',
|
||||
mapServerURL: 'http://192.168.0.31:8089/joysuch/jsmap/data/map',
|
||||
mapServerURL: 'http://192.168.192.201:7024/joysuch/jsmap/data/map',
|
||||
openingAnimation: false,
|
||||
enableLighting: true,
|
||||
enableShadows: true,
|
||||
|
|
Loading…
Reference in New Issue