diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js index 825b523a3..8eea24e5a 100644 --- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js +++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js @@ -41,10 +41,24 @@ function initialLoad() { processAfterInitializationMap(); //Access gps and make zoom to server location as map center //navigator.geolocation.getCurrentPosition(success, error); + setPageTitle(); $("#loading").hide(); } } +function setPageTitle() { + var hash = window.parent.location.hash; + if(hash) { + var startIdx = hash.indexOf("/") + 1; + var lastIdx = hash.length; + var deviceInfoString = hash.substring(startIdx,lastIdx); + var deviceInfo = JSON.parse(deviceInfoString); + if(deviceInfo) { + var newTitle = "[ " + deviceInfo.device.id + "]" + " - Geo Dashboard [" + deviceInfo.device.type + "]"; + window.parent.document.title = newTitle; + } + } +} //function success(position) { // var browserLatitude = position.coords.latitude;