Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map GetFeatureInfo #2830

Merged
merged 33 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
662dcd5
WIP
mdastous-bentley Dec 2, 2021
efbf3f4
WIP
mdastous-bentley Dec 3, 2021
0356421
WIP
mdastous-bentley Dec 8, 2021
a572228
merged master
mdastous-bentley Dec 8, 2021
f66f8e1
Unload data manager when the widget is unmounted.
mdastous-bentley Dec 8, 2021
b59cc19
Refactored getTooltip and getMapFeatureInfo code.
mdastous-bentley Dec 9, 2021
7ddf212
Only add category when a sublayer has at least one record.
mdastous-bentley Dec 9, 2021
48a7d46
Added MapFeatureInfoTool
mdastous-bentley Dec 9, 2021
6ef44fc
Added default feature info implementation
mdastous-bentley Dec 9, 2021
6adf5be
Renamed *identifyHit to *mapHit
mdastous-bentley Dec 10, 2021
f7de738
Merge remote-tracking branch 'origin/master' into geo/getfeatureinfo
mdastous-bentley Jan 6, 2022
6d961fb
Added FeatureInfoUiItemsProvider.
mdastous-bentley Feb 4, 2022
401fe9e
merged master
mdastous-bentley Feb 4, 2022
396befc
Created dedicated file for FeatureInfoUiItemProvider. API / UI tweaks.
mdastous-bentley Feb 16, 2022
4f7ff0d
Code refactoring, added missing release tag.
mdastous-bentley Feb 16, 2022
4a6f685
Added 'No results' message in widget when no data is returned by server.
mdastous-bentley Feb 16, 2022
6f6845a
Make ui-test-app inilize maplayers widget correctly and move widget p…
mdastous-bentley Feb 16, 2022
5859932
added changelog.
mdastous-bentley Feb 16, 2022
af5df40
Added extract API, added missing release tag.
mdastous-bentley Feb 16, 2022
2320739
Merge remote-tracking branch 'origin/master' into geo/getfeatureinfo
mdastous-bentley Feb 16, 2022
fed7bbf
Updated core-front-end extracted api
mdastous-bentley Feb 16, 2022
78ef0ef
Improved exceptions handling
mdastous-bentley Feb 17, 2022
de4c14c
More exceptions handling
mdastous-bentley Feb 17, 2022
f5ca8b5
Improve exception handling.
mdastous-bentley Feb 17, 2022
7fcb5d5
Fixed lint errors.
mdastous-bentley Feb 17, 2022
6011b0b
Merged master
mdastous-bentley Feb 17, 2022
8a978cd
Merge remote-tracking branch 'origin/master' into geo/getfeatureinfo
mdastous-bentley Feb 18, 2022
5d8c03c
Merge remote-tracking branch 'origin/master' into geo/getfeatureinfo
mdastous-bentley Feb 18, 2022
144a639
extract-api
mdastous-bentley Feb 18, 2022
27abdc4
extract api
mdastous-bentley Feb 18, 2022
279da48
Removed widget control registration.
mdastous-bentley Feb 18, 2022
ebb1ef1
lint
mdastous-bentley Feb 18, 2022
c3b21aa
Update extensions/map-layers/src/mapLayers.ts
aruniverse Feb 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions core/frontend/src/Viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,27 +949,29 @@ export abstract class Viewport implements IDisposable, TileUser {

this.forEachMapTreeRef(async (tree) => promises.push(tree.getMapFeatureInfo(hit)));

const results = await Promise.all(promises);
const featureInfo: MapFeatureInfo = {};

const worldPoint = hit.hitPoint.clone();
let cartoHitPoint: Cartographic|undefined;
const backgroundMapGeometry = hit.viewport.displayStyle.getBackgroundMapGeometry();
if (undefined !== backgroundMapGeometry) {
cartoHitPoint = await backgroundMapGeometry.dbToCartographicFromGcs(worldPoint);
featureInfo.hitPoint = await backgroundMapGeometry.dbToCartographicFromGcs(worldPoint);
}

const featureInfo: MapFeatureInfo = {hitPoint: cartoHitPoint};
for (const result of results)
if (result !== undefined) {
try {
const results = await Promise.all(promises);
pmconne marked this conversation as resolved.
Show resolved Hide resolved

if (featureInfo.layerInfo === undefined) {
featureInfo.layerInfo = [];
}
for (const result of results)
if (result !== undefined) {

featureInfo.layerInfo.push(...result);
}
return featureInfo;
if (featureInfo.layerInfo === undefined) {
featureInfo.layerInfo = [];
}

featureInfo.layerInfo.push(...result);
}
} catch {
}
return featureInfo;
}

/** If this event has one or more listeners, collection of timing statistics related to rendering frames is enabled. Frame statistics will be received by the listeners whenever a frame is finished rendering.
Expand Down
29 changes: 22 additions & 7 deletions core/frontend/src/tile/map/MapTileTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import { SceneContext } from "../../ViewContext";
import { ScreenViewport } from "../../Viewport";
import {
BingElevationProvider, createDefaultViewFlagOverrides, DisclosedTileTreeSet, EllipsoidTerrainProvider, GeometryTileTreeReference, getCesiumTerrainProvider, ImageryMapLayerTreeReference, ImageryMapTileTree,
MapCartoRectangle, MapTile, MapTileLoader, MapTilingScheme, PlanarTilePatch, QuadId, RealityTileDrawArgs, RealityTileTree, RealityTileTreeParams, Tile, TileDrawArgs,
TileLoadPriority, TileParams, TileTree, TileTreeLoadStatus, TileTreeOwner, TileTreeReference, TileTreeSupplier, UpsampledMapTile, WebMercatorTilingScheme,
MapLayerFeatureInfo,
MapCartoRectangle, MapLayerFeatureInfo, MapTile, MapTileLoader, MapTilingScheme, PlanarTilePatch, QuadId, RealityTileDrawArgs, RealityTileTree, RealityTileTreeParams, Tile,
TileDrawArgs, TileLoadPriority, TileParams, TileTree, TileTreeLoadStatus, TileTreeOwner, TileTreeReference, TileTreeSupplier, UpsampledMapTile,
WebMercatorTilingScheme,
} from "../internal";

const scratchPoint = Point3d.create();
Expand Down Expand Up @@ -785,7 +785,15 @@ export class MapTileTreeReference extends TileTreeReference {
return undefined;

const worldPoint = hit.hitPoint.clone();
const cartoGraphic = await backgroundMapGeometry.dbToCartographicFromGcs(worldPoint);
let cartoGraphic: Cartographic|undefined;
try {
cartoGraphic = await backgroundMapGeometry.dbToCartographicFromGcs(worldPoint);
} catch {
}
if (!cartoGraphic) {
return undefined;
}

const strings = [];
const imageryTreeRef = this.imageryTreeFromTreeModelIds(hit.modelId, hit.sourceId);
if (imageryTreeRef !== undefined) {
Expand All @@ -797,8 +805,15 @@ export class MapTileTreeReference extends TileTreeReference {
const imageryTree = imageryTreeRef.treeOwner.tileTree as ImageryMapTileTree;
if (imageryTree) {
for (const imageryTile of terrainTile.imageryTiles) {
if (imageryTree === imageryTile.imageryTree && imageryTile.rectangle.containsCartographic(cartoGraphic))
await func (imageryTreeRef, imageryTile.quadId, cartoGraphic, imageryTree);
if (imageryTree === imageryTile.imageryTree && imageryTile.rectangle.containsCartographic(cartoGraphic)) {
try {
await func (imageryTreeRef, imageryTile.quadId, cartoGraphic, imageryTree);
} catch {
// continue iterating even though we got a failure.
}

}

}
}
}
Expand All @@ -825,7 +840,7 @@ export class MapTileTreeReference extends TileTreeReference {
if (carto) {
strings.push(`Latitude: ${carto.latitudeDegrees.toFixed(4)}`);
strings.push(`Longitude: ${carto.longitudeDegrees.toFixed(4)}`);
if (this.settings.applyTerrain) {
if (this.settings.applyTerrain && tree.terrainExaggeration !== 0.0) {
const geodeticHeight = (carto.height - tree.bimElevationBias) / tree.terrainExaggeration;
pmconne marked this conversation as resolved.
Show resolved Hide resolved
strings.push(`Height (Meters) Geodetic: ${geodeticHeight.toFixed(1)} Sea Level: ${(geodeticHeight - tree.geodeticOffset).toFixed(1)}`);
}
Expand Down