首页 / 浏览问题 / 三维GIS / 问题详情
description:''怎么改变其内容(后台传入)
1EXP 2020年05月06日
// 添加自定义模型
addModel(lon, lat, name) {
  var entity = this.viewer.entities.add({
    message: '消防员信息',
    name: name ,
    // 108.947228, 34.260825
    position: Cesium.Cartesian3.fromDegrees(parseFloat(lon), parseFloat(lat), 50),
    model: {
      url: '../../../../assets/CesiumAir/Cesium_Air.glb'
      // uri: 'https://a.amap.com/jsapi_demos/static/gltf/Duck.gltf'
    },
    description: '<table><tr><th>区域</th><td> '+{{ this.name }}+' </td></tr>',
    // description: '<table>\n' +
    //   '<tr>\n' +
    //   '\t<th>区域</th>\n' +
    //   '\t<td> + '{{ this.name }}' + </td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th>负责人</th>\t\n' +
    //   '\t<td>张三</td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th>归属中队</th>\t\n' +
    //   '\t<td>高新消防中队</td>\n' +
    //   '</tr><tr>\n' +
    //   '\t<th>成立时间</th>\t\n' +
    //   '\t<td>2020年3月2日</td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th style="right: calc()">初始化产品清单</th>\n' +
    //   '\t<td><button type="button">点击查看</button></td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th>巡查次数</th>\n' +
    //   '\t<td>15次</td>\n' +
    //   '\t<td><button type="button">点击查看</button></td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th>疑似丢失装备数</th>\n' +
    //   '\t<td>5件</td>\n' +
    //   '\t<td><button type="button">点击查看</button></td>\n' +
    //   '</tr>\n' +
    //   '<tr>\n' +
    //   '\t<th>过期产品清单</th>\n' +
    //   '\t<td><button type="button">点击查看</button></td>\n' +
    //   '</tr>\n' +
    //   '\t</table>',
    scale: 10, // 和原始大小相比的缩放比例
    minimumPixelSize: 100 // 最小尺寸,防止太小而看不见
  })
 return this.viewer.trackedEntity = entity ;
},

1个回答

您好,您具体需要实现什么?
孟超
1
2,560EXP 2020年05月07日

你好  我现在遇到的问题是

在这个属性里边description,写了<a></a>标签 想跳转到我其他的.vue 页面,能帮忙分析下么 

您好您可以参考一下https://www.cnblogs.com/huqi-code/p/8426594.html方法二,我这边试了一下是可以进行跳转的。

//方法二 var entity = viewer.entities.getOrCreateEntity('uniqueId');   
您好   您说的是这个么   这是跳转到另外一个entity么?
description = '\ <img\ width="50%"\ style="float:left; margin: 0 1em 1em 0;"\ src="//cesiumjs.org/images/2015/02-02/Flag_of_Wyoming.svg"/>\ <p>\ Wyoming is a state in the mountain region of the Western \ United States.\ </p>\ <p>\ Wyoming is the 10th most extensive, but the least populous \ and the second least densely populated of the 50 United \ States. The western two thirds of the state is covered mostly \ with the mountain ranges and rangelands in the foothills of \ the eastern Rocky Mountains, while the eastern third of the \ state is high elevation prairie known as the High Plains. \ Cheyenne is the capital and the most populous city in Wyoming, \ with a population estimate of 62,448 in 2013.\ </p>\ <p>\ Source: \ <a style="color: WHITE"\ target="_blank"\ href="http://en.wikipedia.org/wiki/Wyoming">Wikpedia</a>\ </p>'

您好  有没有可能跳转到微型消防站页面去   现在是在description 这个div里边打开的

您好   在吗  方便添加个vx么
您好,您是怎么添加跳转的。如果是在entity中加载链接应该是可以跳转到另一个页面的。
是可以的   但是只是在entity这个div里边跳转的, 还是在同一个页面,不是跳转到了其他新打开的页面
您要是vue的话,您尝试写一个方法通过路由跳转到某一个页面。应该可以解决您的问题。
...