# 迁徙图
vc-migrate-map
组件用于加载迁徙图,可通过样式配置每条线路的样式。
# 示例
# 添加迁徙图到场景
# 预览
收起
<template>
<div class="viewer">
<vc-viewer @ready="ready" :shouldAnimate="true">
<vc-migrate-map ref="migrate" :linkStyle="data" :source="source" >
</vc-migrate-map>
</vc-viewer>
<div class="demo-tool">
<el-button size="small" class="md-raised md-accent" @click="flyTo">定位</el-button>
</div>
</div>
</template>
<script>
export default {
data () {
return {
data: undefined,
source:"/statics/SampleData/heatmapData/xx.json"
}
},
methods: {
flyTo(){
this.$refs.migrate.flyTo()
},
ready (cesiumInstance) {
this.cesiumInstance = cesiumInstance
const {Cesium, viewer} = this.cesiumInstance
viewer.scene.debugShowFramesPerSecond =true
let _this = this
Cesium.Resource.fetchJson({url: '/statics/SampleData/heatmapData/migrate1.json'}).then((data)=>{
_this.data = data
})
},
}
}
</script>
# 属性
属性名 | 类型 | 默认值 | 描述 |
---|---|---|---|
linkStyle | Object | undefined | optional 指定迁徙图的样式 |
source | Object | string | optional 指定迁徙图的数据源 |
# 方法
方法名 | 参数 | 描述 |
---|---|---|
changeItemStyle | links | 改变单个对象的样式 |
flyTo | 定位到数据 |
# 事件
事件名 | 参数 | 描述 |
---|---|---|
ready | {Cesium, viewer} | 该组件渲染完毕时触发,返回 Cesium 类, viewer 实例。 |