Merge pull request #781 from rasika/geo-fencing-issues

Android Sense Location not shown issue
revert-dabc3590
Madhawa Perera 7 years ago committed by GitHub
commit b814c2e123

@ -153,5 +153,5 @@ select meta_owner, meta_deviceId, meta_timestamp, data_type as type, data_receiv
insert into DataStream; insert into DataStream;
from AndroidSense[meta_type == 'gps'] from AndroidSense[meta_type == 'gps']
select meta_deviceId ,meta_type as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude select meta_deviceId ,'android_sense' as meta_deviceType, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude
insert into geoLocationStream; insert into geoLocationStream;

@ -31,52 +31,52 @@
{{/zone}} {{/zone}}
{{#zone "device-details"}} {{#zone "device-details"}}
<span class="device-id"
data-deviceid="{{device.deviceIdentifier}}"
data-type="{{device.type}}"></span>
{{/zone}} {{/zone}}
{{#zone "device-view-tabs"}} {{#zone "device-view-tabs"}}
<li class="active"><a class="list-group-item" href="#device_statistics" role="tab" <li class="active"><a class="list-group-item" href="#device_statistics" role="tab"
data-toggle="tab" aria-controls="device_statistics">Device data-toggle="tab" aria-controls="device_statistics">Device
Statistics</a> Statistics</a>
</li> </li>
<li><a class="list-group-item location_tab" href="#geo_dashboard" role="tab" data-toggle="tab" <li><a class="initGeoLocationLink" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard">Device Location</a></li> aria-controls="geo_dashboard"
data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}">Device Location</a></li>
{{/zone}} {{/zone}}
{{#zone "device-view-tab-contents"}} {{#zone "device-view-tab-contents"}}
<div class="panel panel-default tab-pane active" <div class="panel panel-default tab-pane active"
id="device_statistics" role="tabpanel" aria-labelledby="device_statistics"> id="device_statistics" role="tabpanel" aria-labelledby="device_statistics">
<div class="panel-heading">Device Statistics</div>
{{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}} {{unit "cdmf.unit.device.type.android_sense.realtime.analytics-view" device=device}}
</div> </div>
<div class="panel panel-default tab-pane" <div class="panel panel-default tab-pane"
id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard"> id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard">
<div class="panel-heading">Device Location</div> {{#if locationEnabled}}
<br/> <div id="location" class="tab-pane">
{{unit "cdmf.unit.geo-dashboard" device=device}} <div class="tab-actions">
{{#if locationHistory}} <div class="action-btn-container" id="location-action-bar">
<div id="device-location" </div>
data-locations = "{{locationHistory}}"> </div>
<br/>
{{unit "cdmf.unit.geo-dashboard" device=device noGeoFencing=false hideSearch=true}}
</div> </div>
<br/>
<a class="padding-left" target="_blank"
href="{{portalUrl}}/portal/dashboards/geo-dashboard/?GLOBAL-STATE={{anchor}}">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-map-location fw-stack-1x"></i>
</span> Add Geo Fencing
</a>
{{else}} {{else}}
<div id="map-error" class="message message-warning"> <div id="map-error" class="message message-warning">
<h4 class="remove-margin"> <h4 class="remove-margin">
<i class="icon fw fw-warning"></i> <i class="icon fw fw-warning"></i>
{{#if geoServicesEnabled}}
Device location information is not available. Device location information is not available.
{{else}}
Geo Location Based Services is not enabled.
{{/if}}
</h4> </h4>
</div> </div>
<p class="add-padding-5x"></p> <p class="add-padding-5x"></p>
<p class="add-padding-5x"></p> <p class="add-padding-5x"></p>
<p class="add-padding-5x"></p> <p class="add-padding-5x"></p>
{{/if}} {{/if}}
<div id="chartWrapper">
</div>
</div> </div>
{{/zone}} {{/zone}}

@ -37,6 +37,8 @@ function onRequest(context) {
viewObject.portalUrl = devicemgtProps['portalURL']; viewObject.portalUrl = devicemgtProps['portalURL'];
viewObject.anchor = encodeURI(JSON.stringify(anchor)); viewObject.anchor = encodeURI(JSON.stringify(anchor));
viewObject.locationHistory = stringify(device.content.locationHistory); viewObject.locationHistory = stringify(device.content.locationHistory);
viewObject.locationEnabled = (device.content.locationHistory.length !== 0);
viewObject.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled;
return viewObject; return viewObject;
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");

Loading…
Cancel
Save