|
|
|
@ -51,6 +51,7 @@ export default {
|
|
|
|
|
selectedItems: [],
|
|
|
|
|
graphicLayer: null,
|
|
|
|
|
baseUrl: basePathUrl + "lib/geoJson/tileset.json",
|
|
|
|
|
carUrl: basePathUrl + "lib/car.gltf",
|
|
|
|
|
map: null,
|
|
|
|
|
options: {
|
|
|
|
|
scene: {
|
|
|
|
@ -101,15 +102,16 @@ export default {
|
|
|
|
|
* 创建车辆图标
|
|
|
|
|
*/
|
|
|
|
|
createCar(list) {
|
|
|
|
|
let _this = this;
|
|
|
|
|
list.map((item, index) => {
|
|
|
|
|
const graphic = new mars3d.graphic.ModelEntity({
|
|
|
|
|
const graphic = new mars3d.graphic.ModelPrimitive({
|
|
|
|
|
id: `car${item.carId}`,
|
|
|
|
|
position: [parseFloat(item.lng), parseFloat(item.lat)],
|
|
|
|
|
style: {
|
|
|
|
|
heading: parseInt(item.drct),
|
|
|
|
|
url: "//data.mars3d.cn/gltf/imap/ce2fddca7bac436d8d318bcd4fdf2d69/gltf/gltf2.gltf",
|
|
|
|
|
scale: 0.5,
|
|
|
|
|
minimumPixelSize: 35,
|
|
|
|
|
url: _this.carUrl,
|
|
|
|
|
scale: 1,
|
|
|
|
|
minimumPixelSize: 40,
|
|
|
|
|
silhouette: true,
|
|
|
|
|
silhouetteColor: "#025CC1",
|
|
|
|
|
silhouetteSize: 2,
|
|
|
|
@ -141,6 +143,10 @@ export default {
|
|
|
|
|
attr: { index: index, remark: "Model示例" },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
graphic.on(mars3d.EventType.click, function (e) {
|
|
|
|
|
_this.$router.push({ path: "/carInfo" });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.graphicLayer.addGraphic(graphic);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
@ -251,7 +257,12 @@ export default {
|
|
|
|
|
const tiles3dLayer = new mars3d.layer.TilesetLayer({
|
|
|
|
|
name: "姑苏区建筑物",
|
|
|
|
|
url: "https://www.jichuanglanhai.com:88/3dtiles/yunkun/tileset.json",
|
|
|
|
|
maximumScreenSpaceError: 1,
|
|
|
|
|
maximumScreenSpaceError: 16,
|
|
|
|
|
maximumMemoryUsage: 1024 / 2,
|
|
|
|
|
dynamicScreenSpaceError: false,
|
|
|
|
|
skipLevelOfDetail: true,
|
|
|
|
|
preferLeaves: true,
|
|
|
|
|
flyTo: false,
|
|
|
|
|
style: {
|
|
|
|
|
color: {
|
|
|
|
|
conditions: [["true", `color("rgba(42, 160, 224, 1)")`]],
|
|
|
|
|