-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from AuScope/AUS-3866
Aus 3866: Add KML layers to map
- Loading branch information
Showing
4 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/app/cesium-map/custom-querier-handler/kml-querier-handler.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { UtilitiesService, LayerModel } from "@auscope/portal-core-ui"; | ||
import { KmlFeatureData } from "cesium"; | ||
|
||
|
||
export class KMLQuerierHandler { | ||
|
||
constructor(private entity: KmlFeatureData) {} | ||
|
||
/** | ||
* Creates an HTML string using a feature's KMLFeatureData | ||
* | ||
* @returns HTML string | ||
*/ | ||
public getHTML(): string { | ||
const extendedData = this.entity['kml']['extendedData']; | ||
let html = '<div class="row"><div class="col-md-3">Name</div><div class="col-md-9">' + this.entity['name'] + '</div></div><hr>'; | ||
for (const attr in extendedData) { | ||
if (extendedData.hasOwnProperty(attr)) { | ||
const data = extendedData[attr]; | ||
let displayName = attr | ||
if (data.hasOwnProperty('displayName') && !UtilitiesService.isEmpty(data['displayName'])) { | ||
displayName = data['displayName']; | ||
} | ||
if (data.hasOwnProperty('value') && !UtilitiesService.isEmpty(data['value'])) { | ||
html += '<div class="row"><div class="col-md-3">' + displayName + '</div><div class="col-md-9">' + data['value'] + '</div></div>'; | ||
} | ||
} | ||
} | ||
html += '</div></div>'; | ||
return html; | ||
} | ||
|
||
/** | ||
* Fetches a feature's name | ||
* | ||
* @returns feature name string | ||
*/ | ||
public getFeatureName(): string { | ||
return this.entity['name']; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters