Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from SoftwareAG/Dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
DarpanLalani authored Jun 13, 2024
2 parents 0b508d5 + 103cb30 commit b43a052
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Smart Map Widget for Cumulocity [<img width="35" src="https://user-images.githubusercontent.com/32765455/211497905-561e9197-18b9-43d5-a023-071d3635f4eb.png"/>](https://github.com/SoftwareAG/cumulocity-smart-map-widget-plugin/releases/download/1.0.2/sag-ps-pkg-smartmap-runtime-widget-1.0.2.zip)
# Smart Map Widget for Cumulocity [<img width="35" src="https://user-images.githubusercontent.com/32765455/211497905-561e9197-18b9-43d5-a023-071d3635f4eb.png"/>](https://github.com/SoftwareAG/cumulocity-smart-map-widget-plugin/releases/download/1.0.3/sag-ps-pkg-smartmap-runtime-widget-1.0.3.zip)



Expand Down Expand Up @@ -69,7 +69,7 @@ The Smart Map widget help you to track real-time device locations in indoor with

### Runtime Widget Deployment?

* This widget support runtime deployment. Download [Runtime Binary](https://github.com/SoftwareAG/cumulocity-smart-map-widget-plugin/releases/download/1.0.2/sag-ps-pkg-smartmap-runtime-widget-1.0.2.zip) and install via Administrations --> Ecosystems --> Applications --> Packages.
* This widget support runtime deployment. Download [Runtime Binary](https://github.com/SoftwareAG/cumulocity-smart-map-widget-plugin/releases/download/1.0.3/sag-ps-pkg-smartmap-runtime-widget-1.0.3.zip) and install via Administrations --> Ecosystems --> Applications --> Packages.


## QuickStart
Expand Down Expand Up @@ -252,6 +252,8 @@ Congratulations! Smart Map is configured.

* **Heat Map Last Event Only:** Switch on to display map based on last location event. As soon as new event comes for same device, existing event location will be removed from map.

* **Simulate Indoor Beacons:** If true, hybrid map will switch to indoor based on last event of Indoor tracker(If last event recieved withing 30 seconds) else it will switch to outdoor map. Useful for Beacons simulation. Applicable on Hybrid map only. Default is false.


* **Default Zoom:** User has ability to change outdoor zoom level. Default is Auto.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cumulocity-smart-map-widget-plugin",
"version": "1.0.2",
"version": "1.0.3",
"description": "The Smart Map widget help you to track real-time device locations in indoor with multi floor infrastructure as well as in outdoor. Smart Map also support real-time Heat map for Indoor and outdoor location events.",
"scripts": {
"start": "c8ycli server",
Expand Down
12 changes: 9 additions & 3 deletions smart-map-widget/component/gp-smart-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class GPSmartMapComponent implements OnInit, OnDestroy, AfterViewInit, On
isHeatMap = false;
isClusterMap = false;
loadChildDevices = true;
simulateIndoorBeacon = false;
isMarkerIconFromAssetType = false;
markerIcon = '';
iconColor = '';
Expand Down Expand Up @@ -337,7 +338,10 @@ export class GPSmartMapComponent implements OnInit, OnDestroy, AfterViewInit, On
if (this._config.eventFragmentType !== null && this._config.eventFragmentType !== undefined) {
this.eventFragmentType = this._config.eventFragmentType;
}

if (this._config.simulateIndoorBeacon !== null && this._config.simulateIndoorBeacon !== undefined) {
this.simulateIndoorBeacon = this._config.simulateIndoorBeacon;
}


}

Expand Down Expand Up @@ -1999,7 +2003,9 @@ export class GPSmartMapComponent implements OnInit, OnDestroy, AfterViewInit, On
console.log(' last tag avg time = ', tag.eventAvgTime);
console.log('last event time difference =' + timeDiff);
}
if (timeDiff < (tag.eventAvgTime * 2)) {
//if (timeDiff < (tag.eventAvgTime * 2)) {

if ( (this.simulateIndoorBeacon && timeDiff < 30) || (!this.simulateIndoorBeacon && timeDiff < (tag.eventAvgTime * 2))) {
this.renderAndSubscribeDevice('GPS', true, tag.deviceId);
} else if (this.isBeaconActive !== null) {
this.renderAndSubscribeDevice('Tag', false, tag.deviceId);
Expand Down Expand Up @@ -2133,7 +2139,7 @@ export class GPSmartMapComponent implements OnInit, OnDestroy, AfterViewInit, On
if (s.type === type) {
if (isDevMode()) { console.log('+-+- UNSUBSCRIBING FOR ', s.id); }
// s.subs.unsubscribe();
this.realTimeService.unsubscribe(s.sub);
this.realTimeService.unsubscribe(s?.subs);
delete this.allSubscriptions[s];
}
});
Expand Down
11 changes: 10 additions & 1 deletion smart-map-widget/config/gp-smart-map-config.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
</div>

<div class="row col-sm-12 col-xs-12">
<div class="col-sm-12 col-xs-12form-horizontal">
<div class="col-sm-12 col-xs-12 form-horizontal">
<div class="col-sm-12 col-xs-12">
<div class="btn-group ">
<label class="c8y-switch ">
Expand All @@ -208,6 +208,15 @@
</label>
</div>
</div>
<div class="col-sm-12 col-xs-12">
<div class="btn-group ">
<label class="c8y-switch ">
<input type="checkbox" [checked]="config.simulateIndoorBeacon"
[(ngModel)]="config.simulateIndoorBeacon" [disabled]='config.mapType !== "Hybrid"'>
<span></span>Simulate Indoor Beacons
</label>
</div>
</div>
</div>
</div>
<div class="row"
Expand Down
4 changes: 4 additions & 0 deletions smart-map-widget/config/gp-smart-map-config.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export class GPSmartMapConfigComponent implements OnInit, OnDestroy, DoCheck {
if (this.config.isLastEventHeatmap === undefined) {
this.config.isLastEventHeatmap = true;
}

if (this.config.simulateIndoorBeacon === undefined) {
this.config.simulateIndoorBeacon = false;
}
if (!this.config.heatMapLegendLow) {
this.config.heatMapLegendLow = 'Low';
}
Expand Down

0 comments on commit b43a052

Please sign in to comment.