Skip to content

Commit

Permalink
Merge pull request #461 from AuScope/AUS-4292
Browse files Browse the repository at this point in the history
AUS-4292 Added styleNVCLAnalyticalGeoJsonEntity function.
  • Loading branch information
stuartwoodman authored Nov 29, 2024
2 parents 89b56b7 + e172f0e commit 7093955
Showing 1 changed file with 26 additions and 1 deletion.
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

0 comments on commit 7093955

Please sign in to comment.