Skip to content

Commit

Permalink
Merge pull request #150 from AuScope/AUS-4094
Browse files Browse the repository at this point in the history
AUS-4094 Fixed spinner, ResourceType, duplicated adding issue.
  • Loading branch information
stuartwoodman authored Nov 13, 2024
2 parents ab1f17c + b036e85 commit 9a3857e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

/**
Expand Down

0 comments on commit 9a3857e

Please sign in to comment.