mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
added updateOfflineUsage()
This commit is contained in:
parent
98a4496d02
commit
7f4ef6a8b9
@ -118,6 +118,12 @@
|
||||
padding: 8px;
|
||||
position: relative; float: right;
|
||||
}
|
||||
#tile-info{
|
||||
background-color: #000000;
|
||||
color: white;
|
||||
padding: 8px;
|
||||
position: relative; float: right;
|
||||
}
|
||||
</style>
|
||||
<script src="../vendor/offline/offline.min.js"></script>
|
||||
<script>
|
||||
@ -152,6 +158,7 @@
|
||||
<div id="button-div1">
|
||||
<button class="basic-btn" data-dojo-type="dijit/form/ToggleButton" id="btn-online-offline">1. Go Offline</button>
|
||||
<button class="basic-btn" id="btn-get-tiles">2. Download Tiles</button>
|
||||
<textarea contenteditable="false" id="tile-info"></textarea>
|
||||
<div id="right-div">
|
||||
<img id="img-offline-indicator" src="../samples/images/blue-pin.png"/>
|
||||
<div id="pending-edits">Pending edits: 0</div>
|
||||
@ -196,6 +203,8 @@ require([
|
||||
|
||||
var pendingEdits = document.getElementById("pending-edits");
|
||||
var btnGetTiles = document.getElementById("btn-get-tiles");
|
||||
var tileInfo = document.getElementById("tile-info")
|
||||
tileInfo.innerHTML = "Tile count: 0\r\nBytes: 0";
|
||||
|
||||
var redPinPath = "../samples/images/red-pin.png";
|
||||
var bluePinPath = "../samples/images/blue-pin.png"
|
||||
@ -422,7 +431,7 @@ require([
|
||||
//using null sets this for CORS
|
||||
baseMapLayer.offline.proxyPath = null;
|
||||
|
||||
on(btnGetTiles,"click",downloadTiles);
|
||||
// on(btnGetTiles,"click",downloadTiles);
|
||||
|
||||
updateOfflineUsage();
|
||||
}
|
||||
@ -433,6 +442,18 @@ require([
|
||||
}.bind(this),_isOnline);
|
||||
}
|
||||
|
||||
function updateOfflineUsage()
|
||||
{
|
||||
baseMapLayer.offline.store.usedSpace(function(result,err){
|
||||
if(result != null){
|
||||
tileInfo.innerHTML = "DB Tile count: " + result.tileCount + "\r\nDB Bytes: " + result.sizeBytes;
|
||||
}
|
||||
else{
|
||||
tileInfo.innerHTML = "DB Tile count: " + count + "\r\nDB Bytes: Error";
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to validate min and max zoom settings of the map
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user