Update appcache-tiles.html to 3.14

This commit is contained in:
Andy Gup 2015-08-06 16:18:01 -06:00
parent 3e69c3aa02
commit e18fd78ac4
2 changed files with 72 additions and 46 deletions

View File

@ -1,9 +1,9 @@
CACHE MANIFEST
# This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator
# Time: Mon Oct 13 2014 12:42:42 GMT-0600 (MDT)
# Time: Thu Aug 06 2015 16:08:40 GMT-0600 (MDT)
CACHE:
# manifest-generator, version: 2.3
# manifest-generator, version: 2.11.0.1
#
# Home Page
appcache-tiles.html
@ -14,15 +14,15 @@ appcache-tiles.html
../samples/jsolib/nls/dojo_en.js
../samples/jsolib/resources/blank.gif
#
#http://js.arcgis.com/3.11/esri/dijit/images/popup-sprite.png
http://js.arcgis.com/3.11/esri/dijit/images/attribute_inspector_sprite.png
#http://js.arcgis.com/3.11/dojo/resources/blank.gif
http://js.arcgis.com/3.11/esri/dijit/images/ajax-loader.gif
http://js.arcgis.com/3.11/esri/images/map/logo-sm.png
http://js.arcgis.com/3.11/esri/images/map/logo-med.png
http://js.arcgis.com/3.11/dijit/themes/claro/claro.css
http://js.arcgis.com/3.12/esri/css/esri.css
http://js.arcgis.com/3.11/esri/nls/jsapi_en-us.js
#http://js.arcgis.com/3.14/esri/dijit/images/popup-sprite.png
http://js.arcgis.com/3.14/esri/dijit/images/attribute_inspector_sprite.png
#http://js.arcgis.com/3.14/dojo/resources/blank.gif
http://js.arcgis.com/3.14/esri/dijit/images/ajax-loader.gif
http://js.arcgis.com/3.14/esri/images/map/logo-sm.png
http://js.arcgis.com/3.14/esri/images/map/logo-med.png
http://js.arcgis.com/3.14/esri/css/esri.css
http://js.arcgis.com/3.14/dijit/themes/claro/claro.css
http://js.arcgis.com/3.14/esri/nls/jsapi_en-us.js
#
//services.arcgisonline.com/ArcGIS/rest/info?f=json
//static.arcgis.com/attribution/World_Topo_Map?f=json
@ -30,15 +30,14 @@ http://js.arcgis.com/3.11/esri/nls/jsapi_en-us.js
//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback
#
# Bootstrap files
//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css
//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css
//esri.github.io/bootstrap-map-js/src/css/bootstrapmap.css
//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js
//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js
//esri.github.io/bootstrap-map-js/src/js/bootstrapmap.js
https://code.jquery.com/jquery-2.1.1.min.js
https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.j
//code.jquery.com/jquery-2.1.3.min.js
# Custom feature service
http://services.arcgis.com/IZtlGBUe4KTzLOl4/arcgis/rest/services/BPX_RTD_BusStops2/FeatureServer/0?f=json
//services1.arcgis.com/M8KJPUwAXP8jhtnM/arcgis/rest/services/Denver_Bus_Stops/FeatureServer/0?f=json
#
# required local html
# /xyz/style.css
@ -46,9 +45,10 @@ http://services.arcgis.com/IZtlGBUe4KTzLOl4/arcgis/rest/services/BPX_RTD_BusStop
../samples/images/blue-pin.png
../samples/images/red-pin.png
../samples/css/modular-popup.css
../vendor/IndexedDBShim/dist/IndexedDBShim.js
../vendor/IndexedDBShim/dist/IndexedDBShim.min.js
../vendor/IndexedDBShim/dist/indexeddbshim.js
../vendor/IndexedDBShim/dist/indexeddbshim.min.js
../vendor/offline/offline.min.js
../lib/tiles/blank_map_tile.png
../lib/tiles/notile.png
../lib/tiles/notile.psd
../utils/appCacheManager.js

View File

@ -31,10 +31,58 @@ ask if you want to reload the application.
<title>Cache Tiles</title>
<!-- Bootstrap core CSS -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://js.arcgis.com/3.12/esri/css/esri.css">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="http://esri.github.io/bootstrap-map-js/src/css/bootstrapmap.css">
<script>
// DO NOT DELETE!
// Listen for application cache update events
// We want to place this as early in the application life-cycle as possible!
window.addEventListener('load', function(evt) {
window.applicationCache.addEventListener('updateready', function(evt) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
// Browser downloaded a new app cache.
if (confirm('A new version of this cache is available.')) {
window.location.reload();
console.log("App cache reloaded");
}
} else {
// Manifest didn't changed. Nothing new to server.
console.log("App cache no change");
}
}, false);
}, false);
// Reserved for debugging on Safari desktop and mobile
// Uncomment when doing any debugging on Safari 8 (or previous versions that support App Cache).
// To delete the application cache file on Safari refer to the following url then close/restart browser:
// http://stackoverflow.com/questions/5615266/how-do-you-clear-the-offline-cache-for-web-apps-in-safari
// function logEvent(event) {
// console.log("Checking for Application Cache Event: " + event.type);
// }
//
// window.applicationCache.addEventListener('checking',logEvent,false);
// window.applicationCache.addEventListener('noupdate',logEvent,false);
// window.applicationCache.addEventListener('downloading',logEvent,false);
// window.applicationCache.addEventListener('cached',logEvent,false);
// window.applicationCache.addEventListener('updateready',logEvent,false);
// window.applicationCache.addEventListener('obsolete',logEvent,false);
//
// // If you need to catch AppCache errors as early as possible to troubleshoot errors.
// // You should delete this for production use.
// window.applicationCache.addEventListener("error",function(err){
// console.log("ApplicationCache listener: " + err.toString() + ", " + JSON.stringify(err));
// if (confirm('There was a problem setting this app up for offline. Reload?')) {
// window.location.reload();
// console.log("App cache reloaded");
// }
// },false);
</script>
<style>
#mapDiv {
min-height: 500px;
@ -115,12 +163,11 @@ ask if you want to reload the application.
require([
"esri/map",
"utils/appCacheManager",
"dojo/on",
"//esri.github.io/bootstrap-map-js/src/js/bootstrapmap.js",
"../dist/offline-tiles-advanced-src.js",
"dojo/domReady!"],
function(Map,AppCacheManager,on,BootstrapMap) {
function(Map,on,BootstrapMap) {
var map;
var tileLayer = null;
@ -131,7 +178,7 @@ require([
var _isOnline = true;
var minZoomAdjust = -1, maxZoomAdjust = 1;
var tiles,appCacheManager;
var tiles;
var EXTENT_BUFFER = 0; //buffers the map extent in meters
var dbsize = document.getElementById("span-dbsize-value");
@ -144,8 +191,6 @@ require([
Offline.check();
Offline.on('up down', updateState );
initAppCacheManager();
/**
* There have been a few bugs in the offline detection library (offline.min.js)
* This is a utility check to 100% validate if the application is online or
@ -157,13 +202,6 @@ require([
});
function initAppCacheManager(){
appCacheManager = new AppCacheManager(true,true);
appCacheManager.on(appCacheManager.CACHE_EVENT,cacheEventHandler);
appCacheManager.on(appCacheManager.CACHE_ERROR,cacheErrorHandler);
appCacheManager.on(appCacheManager.CACHE_LOADED,cacheLoaderHandler);
}
function startMap(){
//Make sure map shows up after a browser refresh
Offline.state === 'up' ? zoom = 18 : zoom = 17;
@ -364,18 +402,6 @@ require([
req.send(null);
}
function cacheLoaderHandler(evt){
if(evt == appCacheManager.CACHE_LOADED) console.log("Application cache successfully loaded!")
}
function cacheEventHandler(evt){
console.log("CACHE EVENT: " + JSON.stringify(evt));
}
function cacheErrorHandler(evt){
console.log("CACHE ERROR: " + JSON.stringify(evt));
}
function panLeft(){
map.panLeft();
}
@ -387,7 +413,7 @@ require([
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</body>
</html>