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

AUS-4292 Added styleNVCLAnalyticalGeoJsonEntity function. #461

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@angular/platform-server": "^18.2.8",
"@angular/router": "^18.2.8",
"@auscope/angular-cesium": "^18.0.1",
"@auscope/portal-core-ui": "^6.5.32",
"@auscope/portal-core-ui": "^6.5.33",
"@csiro-geoanalytics/ng": "^2.5.0",
"@csiro-geoanalytics/utils-rxjs": "^2.0.1",
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LOCAL_STORAGE, StorageService } from 'ngx-webstorage-service';
import { LayerManagerService } from 'app/services/ui/layer-manager.service';
import { UILayerModelService } from 'app/services/ui/uilayer-model.service';
import { UILayerModel } from 'app/menupanel/common/model/ui/uilayer.model';

declare var Cesium;
@Injectable()
export class NVCLBoreholeAnalyticService {

Expand All @@ -25,6 +25,30 @@ export class NVCLBoreholeAnalyticService {
private uiLayerModelService: UILayerModelService,
@Inject(LOCAL_STORAGE) private storage: StorageService) {
}

private styleNVCLAnalyticalGeoJsonEntity(entity) {
let dotColor = Cesium.Color.YELLOW;
if (entity.properties.Message) {
const message = entity.properties.Message.getValue();
if (message.indexOf('Hit') >= 0) {
dotColor = Cesium.Color.BLUE;
} else if (message.indexOf('Fail') >= 0 || message.indexOf('Miss') >= 0) {
dotColor = Cesium.Color.RED;
} else {
dotColor = Cesium.Color.YELLOW;
}
}
entity.point = new Cesium.PointGraphics({
color: dotColor,
outlineColor: dotColor,
outlineWidth: 2,
pixelSize: 20,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1.0, 8000000.0),
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
scaleByDistance: new Cesium.NearFarScalar(1.5e2, 0.35, 1.5e7, 0.35),
});
}
public addGeoJsonLayer(name: string, jsonData: any) {
let layerId = 'GEOJSON_' + name;
if (this.uiLayerModelService.isLayerAdded(layerId)){
Expand All @@ -37,6 +61,7 @@ export class NVCLBoreholeAnalyticService {
// Make a layer model object
layerRec = me.layerHandlerService.makeCustomGEOJSONLayerRecord(name, proxyUrl, jsonData);
layerRec.group = 'geojson-layer';
layerRec.stylefn = this.styleNVCLAnalyticalGeoJsonEntity;
// Configure layers so it can be added to map
const uiLayerModel = new UILayerModel(layerRec.id, 100, me.renderStatusService.getStatusBSubject(layerRec));
me.uiLayerModelService.setUILayerModel(layerRec.id, uiLayerModel);
Expand Down
Loading