diff --git a/3dwebclient/script.js b/3dwebclient/script.js index 08e23abc..a22f74fe 100644 --- a/3dwebclient/script.js +++ b/3dwebclient/script.js @@ -402,7 +402,7 @@ function listHighlightedObjects() { var highlightingListElement = document.getElementById("citydb_highlightinglist"); emptySelectBox(highlightingListElement, function() { - var highlightedObjects = webMap.getAllHightlightedObjects(); + var highlightedObjects = webMap.getAllHighlightedObjects(); for (var i = 0; i < highlightedObjects.length; i++) { var option = document.createElement("option"); option.text = highlightedObjects[i]; @@ -588,10 +588,12 @@ function addEventListeners(layer) { if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var featureArray = object._content._batchTable._features; + var featureArray = object._content._features; if (!Cesium.defined(featureArray)) return; var objectId = featureArray[object._batchId].getProperty("id"); + if (!Cesium.defined(objectId)) + return; targetEntity = new Cesium.Entity({ id: objectId diff --git a/js/3dcitydb-web-map.js b/js/3dcitydb-web-map.js index 96f133e1..483756a6 100644 --- a/js/3dcitydb-web-map.js +++ b/js/3dcitydb-web-map.js @@ -284,7 +284,7 @@ * get highlighted objects from all layers * @returns {Array} */ - WebMap3DCityDB.prototype.getAllHightlightedObjects = function () { + WebMap3DCityDB.prototype.getAllHighlightedObjects = function () { var results = []; var count = 0; var layers = this._layers; diff --git a/js/Cesium3DTilesDataLayer.js b/js/Cesium3DTilesDataLayer.js index 44478695..125e1641 100644 --- a/js/Cesium3DTilesDataLayer.js +++ b/js/Cesium3DTilesDataLayer.js @@ -288,10 +288,10 @@ if (Cesium.defined(features)) { var object = features[k]; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) return; - var objectId = idArray[object._batchId]; + var objectId = featureArray[object._batchId].getProperty("id"); if (scope.isInHighlightedList(objectId) && !Cesium.Color.equals(object.color, scope._highlightColor)) { scope.highlightObject(object) @@ -320,10 +320,12 @@ if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) + return; + var objectId = featureArray[object._batchId].getProperty("id"); + if (!Cesium.defined(objectId)) return; - var objectId = idArray[object._batchId]; if (scope.isInHighlightedList(objectId)) return; @@ -341,10 +343,12 @@ if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) + return; + var objectId = featureArray[object._batchId].getProperty("id"); + if (!Cesium.defined(objectId)) return; - var objectId = idArray[object._batchId]; if (scope.isInHighlightedList(objectId)) { scope.unHighlight([objectId]); @@ -359,10 +363,10 @@ if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) return; - var objectId = idArray[object._batchId]; + var objectId = featureArray[object._batchId].getProperty("id"); if (scope.isInHighlightedList(objectId)) return; @@ -375,10 +379,10 @@ if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) return; - var objectId = idArray[object._batchId]; + var objectId = featureArray[object._batchId].getProperty("id"); if (scope.isInHighlightedList(objectId)) return; @@ -460,11 +464,11 @@ if (!(object._content instanceof Cesium.Batched3DModel3DTileContent)) return; - var idArray = object._content._batchTable._properties.id; - if (!Cesium.defined(idArray)) + var featureArray = object._content._features; + if (!Cesium.defined(featureArray)) return; + var objectId = featureArray[object._batchId].getProperty("id"); - var objectId = idArray[object._batchId]; var highlightColor = this._highlightedObjects[objectId]; if (highlightColor) { if (!Cesium.defined(object.getProperty("originalColorValue"))) {