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;
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;

@ -31,6 +31,9 @@
{{/zone}}
{{#zone "device-details"}}
<span class="device-id"
data-deviceid="{{device.deviceIdentifier}}"
data-type="{{device.type}}"></span>
{{/zone}}
{{#zone "device-view-tabs"}}
@ -38,45 +41,42 @@
data-toggle="tab" aria-controls="device_statistics">Device
Statistics</a>
</li>
<li><a class="list-group-item location_tab" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard">Device Location</a></li>
<li><a class="initGeoLocationLink" href="#geo_dashboard" role="tab" data-toggle="tab"
aria-controls="geo_dashboard"
data-lat="{{device.location.latitude}}"
data-long="{{device.location.longitude}}">Device Location</a></li>
{{/zone}}
{{#zone "device-view-tab-contents"}}
<div class="panel panel-default tab-pane active"
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}}
</div>
<div class="panel panel-default tab-pane"
id="geo_dashboard" role="tabpanel" aria-labelledby="geo_dashboard">
<div class="panel-heading">Device Location</div>
<br/>
{{unit "cdmf.unit.geo-dashboard" device=device}}
{{#if locationHistory}}
<div id="device-location"
data-locations = "{{locationHistory}}">
{{#if locationEnabled}}
<div id="location" class="tab-pane">
<div class="tab-actions">
<div class="action-btn-container" id="location-action-bar">
</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>
{{unit "cdmf.unit.geo-dashboard" device=device noGeoFencing=false hideSearch=true}}
</div>
{{else}}
<div id="map-error" class="message message-warning">
<h4 class="remove-margin">
<i class="icon fw fw-warning"></i>
{{#if geoServicesEnabled}}
Device location information is not available.
{{else}}
Geo Location Based Services is not enabled.
{{/if}}
</h4>
</div>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
<p class="add-padding-5x"></p>
{{/if}}
<div id="chartWrapper">
</div>
</div>
{{/zone}}

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

Loading…
Cancel
Save