From f3cc5b7bda4737d115265e98a3287781bc0063df Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Tue, 10 Jun 2014 11:53:44 -0600 Subject: [PATCH] basic goOffline func working --- samples/test2.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/samples/test2.html b/samples/test2.html index 855bb1d..81b4a55 100644 --- a/samples/test2.html +++ b/samples/test2.html @@ -294,15 +294,27 @@ */ function goOnline(){ - console.log("Online"); + console.log("Going online..."); + offlineFeaturesManager.goOnline(function(success,error){ + if(error === undefined){ + btnOnlineOffline.innerHTML = "2. Go Offline"; + imgOfflineIndicator.src = bluePinPath; + console.log("offlineFeatureManager is online."); + } + else{ + alert("There was a problem syncing offline edits: " + JSON.stringify(error)); + } + }); + + updateOfflineUsage(); + if(typeof baseMapLayer != "undefined") baseMapLayer.goOnline(); } function goOffline(){ console.log("Going offline..."); btnOnlineOffline.innerHTML = "2. Go Online"; imgOfflineIndicator.src = redPinPath; - imgOfflineIndicator.offlineColor = "red"; -// offlineFeaturesManager.goOffline(); + offlineFeaturesManager.goOffline(); if(typeof tileLayer != "undefined") tileLayer.goOffline(); }