Commit 43a76e78 authored by caicaicai's avatar caicaicai

修改

parent 381dbedf
...@@ -170,7 +170,69 @@ export default { ...@@ -170,7 +170,69 @@ export default {
}); });
graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer) graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
}, },
//实时位置
addDemoGraphics(graphicLayer4) {
let that = this;
const graphic = new mars3d.graphic.ModelPrimitive({
style: {
url: "//data.mars3d.cn/gltf/mars/car/tufangche.glb",
scale: 0.1,
minimumPixelSize: 50,
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight: {
type: mars3d.EventType.click,
silhouette: true,
silhouetteColor: "#ff0000",
silhouetteSize: 4
},
label: {
// 不需要文字时,去掉label配置即可
text: "鲁A12345",
font_size: 16,
color: "#ffffff",
outline: true,
outlineColor: "#000000",
pixelOffsetY: -20,
distanceDisplayCondition: true,
distanceDisplayCondition_far: 50000,
distanceDisplayCondition_near: 0
}
},
})
graphicLayer4.addGraphic(graphic)
// 设置动态位置
graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint()) // 首次出现的位置
})
graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint(), 20) // 按20秒运动至指定位置
})
// 定时更新动态位置(setInterval为演示)
setInterval(() => {
graphicLayer4.eachGraphic((graphic) => {
graphic.addDynamicPosition(that.randomPoint(), 20)
})
}, 20000)
},
// 取区域内的随机点
randomPoint() {
const jd = this.random(117.130666 * 1000, 117.130241 * 1000) / 1000
const wd = this.random(36.655207 * 1000, 36.665207 * 1000) / 1000
console.log("jd",jd);
console.log("wd",wd);
return Cesium.Cartesian3.fromDegrees(jd, wd, 500)
},
random(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min)
},
//获取实时位置坐标
getShiShiWeiZhiZuoBiaoFn(){
let that = this;
httpGet(screenMapSetUpQuery,{size:9999}).then((res) => {
});
},
getSampledPositionProperty(points){ getSampledPositionProperty(points){
let property = new Cesium.SampledPositionProperty(); let property = new Cesium.SampledPositionProperty();
let start = this.map.clock.currentTime; let start = this.map.clock.currentTime;
......
...@@ -4,8 +4,8 @@ const config = { ...@@ -4,8 +4,8 @@ const config = {
// BASE_URL: 'http://8.143.203.103:9090', //线上地址2 // BASE_URL: 'http://8.143.203.103:9090', //线上地址2
// REAL_URL: 'http://8.143.203.103:9090', //线上地址2 // REAL_URL: 'http://8.143.203.103:9090', //线上地址2
BASE_URL: 'http://192.168.0.111:9090', BASE_URL: 'http://192.168.0.108:8001',
REAL_URL: 'http://192.168.0.111:9090', REAL_URL: 'http://192.168.0.108:8001',
TOKEN_KEY: 'token', TOKEN_KEY: 'token',
USER_KEY: 'userInfo', USER_KEY: 'userInfo',
......
...@@ -10,8 +10,8 @@ module.exports = { ...@@ -10,8 +10,8 @@ module.exports = {
productionSourceMap:false, //去掉打包的时候生成的map文件 productionSourceMap:false, //去掉打包的时候生成的map文件
lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码 lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
devServer: { devServer: {
host: '192.168.0.101', // 也可以直接写IP地址这样方便真机测试 //host: '192.168.0.101', // 也可以直接写IP地址这样方便真机测试
//host: 'localhost', host: 'localhost',
port: 3002, // 端口号 port: 3002, // 端口号
https: false, // https:{type:Boolean} https: false, // https:{type:Boolean}
open: true, // 配置自动启动浏览器 open: true, // 配置自动启动浏览器
...@@ -31,13 +31,13 @@ module.exports = { ...@@ -31,13 +31,13 @@ module.exports = {
'/dianziweilan': { '/dianziweilan': {
target: 'http://192.168.0.111:9090' target: 'http://192.168.0.108:8001'
}, },
'/auth': { '/auth': {
target: 'http://192.168.0.111:9090', target: 'http://192.168.0.108:8001',
}, },
'/pic': { '/pic': {
target: 'http://192.168.0.111/avatar/', target: 'http://192.168.0.108/avatar/',
pathRewrite: { '^/pic': '' }, pathRewrite: { '^/pic': '' },
changeOrigin: true, changeOrigin: true,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment