From 3690c1b2c5ac6e1d112deb23136f42e8e3eb2db4 Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Mon, 29 Sep 2014 16:05:33 -0600 Subject: [PATCH] Closes #233 - rename isDBWriteable() --- doc/tpklayer.md | 16 ++++++++-------- lib/tpk/TPKLayer.js | 2 +- test/spec/tpkLayerSpec.js | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/tpklayer.md b/doc/tpklayer.md index d1a5d59..c8b6e6b 100644 --- a/doc/tpklayer.md +++ b/doc/tpklayer.md @@ -11,14 +11,6 @@ Constructor | Description --- | --- `O.esri.TPK.TPKLayer()` | Creates an instance of the TPKLayer class. This library allows you to extend a TiledMapServiceLayer for the purpose of displaying a TPK file as a map. -###Methods -Methods | Returns | Description ---- | --- | --- -`extend(files)`| nothing | Overrides a TiledMapServiceLayer. Files is an array of Entry Objects derived from a zip (tpk) file parsed via zip.js. As soon as this method is called it will extract all the necessary information from the zip file and display the TPK as a map. -`setMaxDBSize(size)`| nothing | (Optional) Let's you specify a maximum size in MBs for the local database. The default is 75MBs. Recommended maximum is 100MBs. Important: Making the database too large can result in browser crashes and slow application performance. -`getDBSize(callback)`| `callback(size,err)` | Returns the size of local database in bytes or an error message. Calling this too often during parsing operations can affect application performance. -`isDBWriteable(value)`| boolean | Default is true. Let's you programmatically allow or not allow the storing of tiles in the local database. This method can help you manage the size of the database. Use this in conjunction with `getDBSize()` on a map pan or zoom event listener. Tile retrieval times from images stored in the database are significantly faster than pulling images from the TPK. - ###Properties Property | Value | Description --- | --- | --- @@ -33,6 +25,14 @@ Property | Value | Description `DB_INIT_ERROR` | "dbInitError"| An event property indicating an error occurred while initializing the database. `NO_SUPPORT_ERROR` | "libNotSupportedError"| An event property indicating the library won't work on this browser. +###Methods +Methods | Returns | Description +--- | --- | --- +`extend(files)`| nothing | Overrides a TiledMapServiceLayer. Files is an array of Entry Objects derived from a zip (tpk) file parsed via zip.js. As soon as this method is called it will extract all the necessary information from the zip file and display the TPK as a map. +`setMaxDBSize(size)`| nothing | (Optional) Let's you specify a maximum size in MBs for the local database. The default is 75MBs. Recommended maximum is 100MBs. Important: Making the database too large can result in browser crashes and slow application performance. +`getDBSize(callback)`| `callback(size,err)` | Returns the size of local database in bytes or an error message. Calling this too often during parsing operations can affect application performance. +`setDBWriteable(value)`| nothing | Default is true. Value is boolean. Let's you programmatically allow or not allow the storing of tiles in the local database. This method can help you manage the size of the database. Use this in conjunction with `getDBSize()` on a map pan or zoom event listener. Tile retrieval times from images stored in the database are significantly faster than pulling images from the TPK. + ###Events Event | Value | Description --- | --- | --- diff --git a/lib/tpk/TPKLayer.js b/lib/tpk/TPKLayer.js index e1b28d5..42283e8 100644 --- a/lib/tpk/TPKLayer.js +++ b/lib/tpk/TPKLayer.js @@ -182,7 +182,7 @@ define([ * Use this in conjunction with getDBSize() on a map pan or zoom event listener. * @param value */ - isDBWriteable: function(/* Boolean */ value){ + setDBWriteable: function(/* Boolean */ value){ this._isDBWriteable = value; }, diff --git a/test/spec/tpkLayerSpec.js b/test/spec/tpkLayerSpec.js index 9addc71..3ed934a 100644 --- a/test/spec/tpkLayerSpec.js +++ b/test/spec/tpkLayerSpec.js @@ -272,7 +272,7 @@ describe("TPKLayer module", function(){ it("Get tiles - do not store", function(done){ var url = "test"; var db = tpkLayer.store; - tpkLayer.isDBWriteable(false); + tpkLayer.setDBWriteable(false); db.deleteAll(function(success,err){ expect(success).toBeTruthy();