From b036e85580cf878a9d4e1fb88f66ce726a33595d Mon Sep 17 00:00:00 2001 From: Lingbo Jiang Date: Wed, 13 Nov 2024 12:08:58 +1100 Subject: [PATCH] AUS-4094 Fixed spinner, ResourceType, duplicated adding issue. --- .../src/lib/service/cswrecords/layer-handler.service.ts | 2 +- .../src/lib/service/geojson/cs-geojson.service.ts | 4 ++-- projects/portal-core-ui/src/lib/utility/utilities.service.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/portal-core-ui/src/lib/service/cswrecords/layer-handler.service.ts b/projects/portal-core-ui/src/lib/service/cswrecords/layer-handler.service.ts index 27ee51c..fd6ef88 100644 --- a/projects/portal-core-ui/src/lib/service/cswrecords/layer-handler.service.ts +++ b/projects/portal-core-ui/src/lib/service/cswrecords/layer-handler.service.ts @@ -155,7 +155,7 @@ export class LayerHandlerService { * @returns LayerModel object */ public makeCustomGEOJSONLayerRecord(name: string, url: string, jsonDoc: {}): LayerModel { - const id = 'GEOJSON_' + name.substring(0, 10) + '_' + Math.floor(Math.random() * 10000).toString(); + const id = 'GEOJSON_' + name; const itemLayer = new LayerModel(); const cswRec = this.makeCustomJsonCSWRec(name, id, url); itemLayer.cswRecords = [cswRec]; diff --git a/projects/portal-core-ui/src/lib/service/geojson/cs-geojson.service.ts b/projects/portal-core-ui/src/lib/service/geojson/cs-geojson.service.ts index 749d0b6..d5a9a35 100644 --- a/projects/portal-core-ui/src/lib/service/geojson/cs-geojson.service.ts +++ b/projects/portal-core-ui/src/lib/service/geojson/cs-geojson.service.ts @@ -72,13 +72,12 @@ export class CsGeoJsonService { if (UtilitiesService.layerContainsResourceType(layer, ResourceType.GEOJSON)) { // add geoJson to map - const jsonUrl = 'https://nvclanalytics.azurewebsites.net/NVCLAnalyticalServices/downloadNVCLJobResult.do?jobid=eb23ac38df87246f8cb89e652692f333&format=json'; const stylefn = me.styleGeoJsonEntity; var promise; if (layer.jsonDoc) { promise = Cesium.GeoJsonDataSource.load(JSON.parse(layer.jsonDoc)); } else { - promise = Cesium.GeoJsonDataSource.load(jsonUrl); + promise = Cesium.GeoJsonDataSource.load(layer.proxyUrl); } promise .then(function (dataSource) { @@ -90,6 +89,7 @@ export class CsGeoJsonService { } layer.csLayers.push(dataSource); me.incrementLayersAdded(layer, 1); + me.renderStatusService.updateComplete(layer, onlineResource, true); }) .catch(function (error) { window.alert(error); diff --git a/projects/portal-core-ui/src/lib/utility/utilities.service.ts b/projects/portal-core-ui/src/lib/utility/utilities.service.ts index f54f97b..f6263cc 100644 --- a/projects/portal-core-ui/src/lib/utility/utilities.service.ts +++ b/projects/portal-core-ui/src/lib/utility/utilities.service.ts @@ -646,7 +646,7 @@ export class UtilitiesService { * @returns a list of supported OnlineResource types as strings */ public static getSupportedOnlineResourceTypes(): ResourceType[] { - return [ResourceType.WMS, ResourceType.IRIS, ResourceType.KML, ResourceType.KMZ, ResourceType.VMF]; + return [ResourceType.WMS, ResourceType.IRIS, ResourceType.KML, ResourceType.KMZ, ResourceType.VMF,ResourceType.GEOJSON]; } /**