最近cesium定位飞行
if (that.entity) { viewer.entities.remove(that.entity); } that.entity = new Cesium.Entity({ id: 'flyTmp', position: Cesium.Cartesian3.fromDegrees(that.pick.jd,that.pick.wd), point: {} }); viewer.entities.add(that.entity); viewer.flyTo(that.entity, { offset: { heading: Cesium.Math.toRadians(0.0), pitch: Cesium.Math.toRadians(-20), range: 20000 }, });
出现错误:
An entity with id flyTmp already exists in this collection
这个集合中已经存在一个id为flyTmp的实体
解决:
删掉 id: 'flyTmp'