Merge pull request #497 from andygup/gh-pages

Update gh-pages
This commit is contained in:
Andy 2017-03-20 10:01:40 -06:00 committed by GitHub
commit 79cb000313
15 changed files with 84 additions and 89 deletions

View File

@ -1,5 +1,11 @@
# offline-editor-js - Changelog
## March 20, 2016
Documentation update only
* Updated markdown pages to reflect minor changes in how github interprets markdown
## Version 3.7.0 - Nov 1, 2016
No breaking changes.

View File

@ -28,7 +28,7 @@ TPK files | **`offline-tpk-min.js`** Reads TPK files and displays and caches the
`src` files are for software development-only. The`min` versions are minified and should be used in production.
#Workflows Supported
# Workflows Supported
The following workflow is currently supported for both both features and tiles:
1) Load web application while online.
@ -46,7 +46,7 @@ Full offline requires the use of an [application manifest](https://developer.moz
__Attachment Support__: Attachments are supported with some limitations. See documentation [here](./doc/attachments.md)
#API and How To Use Docs
# API and How To Use Docs
Go __[here](http://esri.github.io/offline-editor-js/demo/)__ to get links to the API docs and How to use docs.
@ -58,20 +58,20 @@ Go __[here](https://github.com/Esri/offline-editor-js/wiki/FAQ)__ for answers to
![Architecture](demo/images/offline_arch.png)
##Setup Instructions
## Setup Instructions
1. [Fork and clone the repo.](https://help.github.com/articles/fork-a-repo)
2. After cloning from github, `cd` into the `offline-editor-js` folder
3. Run `git submodule init` and `git submodule update`
4. Try out the apps in the `/samples` folder. If they run, then everything is set up correctly.
##Build Instructions
## Build Instructions
1. From the root directory run `npm install`
2. Run `Grunt build`. If there are no errors, the minimized _(min)_ and source _(src)_ versions of the libraries will be output to `/dist`
3. For production automation see the npm scripts listed in [package.json](https://github.com/Esri/offline-editor-js/blob/master/package.json).
##Limitations
## Limitations
* Currently does not support related tables, domains or subtypes. The ArcGIS Runtime SDKs fully support these and more.
* There are browser limitations and technical dependencies. The offline capabilities in this toolkit depend on certain JavaScript capabilities being present in the browser. Go [here](doc/dependencies.md) for a detailed breakdown.
@ -83,7 +83,7 @@ Go __[here](https://github.com/Esri/offline-editor-js/wiki/FAQ)__ for answers to
* Only the latest versions of Chrome, Firefox and Safari are supported.
* The most up to date information on this library's browser support can be found [here](http://esri.github.io/offline-editor-js/demo/index.html#support).
##Dependencies
## Dependencies
* [ArcGIS API for JavaScript (v3.14+)](https://developers.arcgis.com/javascript/)
* [Offline.js](http://github.hubspot.com/offline/docs/welcome/) - it allows detection of the online/offline condition and provides events to hook callbacks on when this condition changes
@ -115,7 +115,7 @@ Anyone and everyone is welcome to contribute. Please see our [guidelines for con
## Licensing
Copyright 2016 Esri
Copyright 2017 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
#Attachment Support
# Attachment Support
The __offline-edit-advanced-min.js__ has support for attachments in offline mode. See [attachments-editor.html](../samples/attachments-editor.html) sample.
##What you can do:
## What you can do:
While your application is in `OFFLINE` mode, you can:
* add attachments to any feature, either a feature that already exists in the server or a newly added feature.
@ -10,7 +10,7 @@ While your application is in `OFFLINE` mode, you can:
* view the attached files (see __limitations__ below)
* when the app goes to `ONLINE` mode, all attachments are sent back to the server and removed from the local database.
##How you do use it:
## How you do use it:
You can either use the ArcGIS FeatureLayer API _(esri.layers.FeatureLayer)_ directly or use the [AttachmentEditor](https://developers.arcgis.com/javascript/jsapi/attachmenteditor-amd.html) widget that supports feature attachment editing. Both approaches work well, and the code you write works the same either if you are on `ONLINE` or `OFFLINE` modes.
The only differences in your code are:
@ -36,7 +36,7 @@ users that have a requirement to run multiple databases:
offlineEdit.initAttachments(function(success, error){ . . . });
###Using the FeatureLayer API
### Using the FeatureLayer API
The FeatureLayer API for handling attachments consists primarily of four methods. In general you should let `OfflineEditAdvanced`
handle interactions with attachments and it's not recommended to interact with the attachments database directly.
@ -47,21 +47,21 @@ handle interactions with attachments and it's not recommended to interact with t
They work the same both in ONLINE and OFFLINE mode. In OFFLINE mode, attachments will be kept in the local database (indexeddb) and sent back to the server when you call `offlineEdit.goOnline()`
##Getting database usage
## Getting database usage
Once a feature layer is extended you can find out how big the database and how many attachments are stored by using the following pattern:
layer.getAttachmentsUsage(function(usage, error) {
console.log("Size: " + usage.sizeBytes + ", attachmentCount: " + usage.attachmentCount);
});
##Resetting the database
## Resetting the database
Under certain circumstances you may want to force the database to delete everything.
layer.resetAttachmentsDatabase(function(result, error) {
console.log("Reset succes: " + result); // result is a boolean
});
###Using the AttachmentEditor widget
### Using the AttachmentEditor widget
The [AttachmentEditor](https://developers.arcgis.com/javascript/jsapi/attachmenteditor-amd.html) is not very fancy, but it's easy to work with:
map.infoWindow.setContent("<div id='content' style='width:100%'></div>");
@ -81,7 +81,7 @@ The [AttachmentEditor](https://developers.arcgis.com/javascript/jsapi/attachment
The widget internally uses the FeatureLayer API, and it works well in OFFLINE mode.
##Limitations
## Limitations
Attachment support in OFFLINE mode has some limitations:
* While in OFFLINE mode, features in a featureLayer don't know whether they have any attachments on the server or any other information about attachments unless you specifically build out that functionality. Therefore `queryAttachmentInfos()` and `deleteAttachments()` won't take their respective attachments into account. Calling `queryAttachmentInfos()` will only return locally stored attachments and `deleteAttachments()` can also only remove local attachments.

View File

@ -1,5 +1,4 @@
Technical Dependencies
======================
# Technical Dependencies
The offline-editor-js projects includes but is not limited to the following dependencies:

View File

@ -102,7 +102,7 @@ Too large of an application can cause a mobile browser to run slugglishly or cra
* Safari - Developer Tools > Show Page Resources > Application Cache (click on the cookie crumbs at the top left of the console window).
###Configuring your web server
### Configuring your web server
Your web server must be able to serve up the MIME TYPE `TEXT/cache-manifest`. If this is missing there's a really good chance that the application cache file won't be served up to your app.
If you have your web server set up to serve no-cache headers, you should temporarily disable that feature. Some browsers will refuse to accept the application cache file if it is served via a no-cache header.
@ -127,7 +127,7 @@ As for IE, this library doesn't currently support any versions.
The application cache file can live anywhere in your web directory. It's common to see it to be placed in the root.
###Support
### Support
Most modern browsers support application cache. For more detailed info refer to [caniuse.com](http://caniuse.com/#search=appcache).
### References

View File

@ -1,7 +1,6 @@
How to use the advanced edit library
====================================
# How to use the advanced edit library
##`OfflineEditAdvanced` library
## `OfflineEditAdvanced` library
This library allows a developer to extend a feature layer with intermittent and full offline editing support. You can combine this functionality with offline tiles. For a complete list of features consult the [OfflineEditAdvanced API doc](offlineeditadvanced.md).
@ -293,7 +292,7 @@ There are two ways to get the dataStore. You can get it from the instance of Off
**Step 5** Once a layer has been extended the offline library will enable it with new methods. Here are a few examples that include code snippets of how to take advantage of some of the library's methods.
####OfflineEditAdvanced.proxyPath
#### OfflineEditAdvanced.proxyPath
By default, the library assumes you are using a CORS-enabled Feature Service. All ArcGIS Online Feature Services are CORS-enabled. If you are hosting your own service and it is not CORS-enabled, then you will need to set this path. More information on downloading and using ArcGIS proxies can be found here: [https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html](https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html)
Here's one example:
@ -304,7 +303,7 @@ Here's one example:
```
####OfflineEditAdvanced.goOffline()
#### OfflineEditAdvanced.goOffline()
Force the library to go offline. Once this condition is set, then any offline edits will be cached locally.
```js
@ -315,7 +314,7 @@ Force the library to go offline. Once this condition is set, then any offline ed
}
```
####OfflineEditAdvanced.goOnline()
#### OfflineEditAdvanced.goOnline()
Force the library to return to an online condition. If there are pending edits, the library will attempt to sync them.
```js
@ -352,7 +351,7 @@ Typically you should only need to call this method once for each online/offline
If there was a an failure and/or errors, it's a good idea to reevaluate the edits that remain in the database because some edits may have been synced and others may still be pending. Only then, and depending on the error message, should the app try to `goOnline()` again.
####OfflineEditAdvanced.getOnlineStatus()
#### OfflineEditAdvanced.getOnlineStatus()
Within your application you can manually check online status and then update your user interface. By using a switch/case statement you can check against three enums that indicate if the library thinks it is offline, online or in the process of reconnecting.
```js
@ -375,7 +374,7 @@ Within your application you can manually check online status and then update you
```
####OfflineEditAdvanced.pendingEditsCount(callback)
#### OfflineEditAdvanced.pendingEditsCount(callback)
You can check if there are any edits pending.
```js

View File

@ -1,7 +1,7 @@
How to use the basic edit library
====================================
##`OfflineEditBasic` library
## `OfflineEditBasic` library
This library allows a developer to extend a feature layer with intermittent offline editing support. You can combine this functionality with offline tiles. For a complete list of features consult the [OfflineEditBasic API doc](offlineeditbasic.md).
@ -80,7 +80,7 @@ NOTE: You can also monitor standard ArcGIS API for JavaScript layer events using
**Step 4** Once a layer has been extended the offline library will enable it with new methods. Here are a few examples that include code snippets of how to take advantage of some of the library's methods.
####OfflineEditBasic.proxyPath
#### OfflineEditBasic.proxyPath
By default, the library assumes you are using a CORS-enabled Feature Service. All ArcGIS Online Feature Services are CORS-enabled. If you are hosting your own service and it is not CORS-enabled, then you will need to set this path. More information on downloading and using ArcGIS proxies can be found here: [https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html](https://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html)
Here's one example:
@ -91,7 +91,7 @@ Here's one example:
```
####OfflineEditBasic.goOffline()
#### OfflineEditBasic.goOffline()
Force the library to go offline. Once this condition is set, then any offline edits will be cached locally.
```js
@ -102,7 +102,7 @@ Force the library to go offline. Once this condition is set, then any offline ed
}
```
####OfflineEditBasic.goOnline()
#### OfflineEditBasic.goOnline()
Force the library to return to an online condition. If there are pending edits, the library will attempt to sync them.
```js
@ -139,7 +139,7 @@ Typically you should only need to call this method once for each online/offline
If there was a failure and/or errors, it's a good idea to reevaluate the edits that remain in the database because some edits may have been synced and others may still be pending. Only then, and depending on the error message, should the app try to `goOnline()` again.
####OfflineEditBasic.getOnlineStatus()
#### OfflineEditBasic.getOnlineStatus()
Within your application you can manually check online status and then update your user interface. By using a switch/case statement you can check against three enums that indicate if the library thinks it is offline, online or in the process of reconnecting.
```js
@ -162,7 +162,7 @@ Within your application you can manually check online status and then update you
```
####OfflineEditBasic.pendingEditsCount(callback)
#### OfflineEditBasic.pendingEditsCount(callback)
You can check if there are any edits pending.
```js

View File

@ -1,7 +1,7 @@
How to use the tiles library
============================
##`tiles` library
## `tiles` library
The `tiles` library allows a developer to extend a tiled layer with offline support.
@ -45,7 +45,7 @@ Approach #1 is for intermittent offline use cases and it uses the `offline-tiles
```
**Step 3** This will enable new offline methods on the layer to prepare for offline mode while still online:
####basemap.prepareForOffline(minLevel,maxLevel,extent,reportProgress)
#### basemap.prepareForOffline(minLevel,maxLevel,extent,reportProgress)
* Integer minLevel
* Integer maxLevel
@ -80,17 +80,17 @@ basemapLayer.prepareForOffline(minLevel, maxLevel, newExtent,
lang.hitch(self,self.reportProgress));
```
####basemap.goOnline()
#### basemap.goOnline()
This method puts the layer in online mode. When in online mode, the layer will behave as regular layers, fetching all tiles from the remote server. If there is no internet connectivity the tiles may appear thanks to the browsers cache, but no attempt will be made to look up tiles in the local database.
####basemap.goOffline()
#### basemap.goOffline()
This method puts the layer in offline mode. When in offline mode, the layer will not fetch any tile from the remote server. It will look up the tiles in the IndexedDB database and display them in the layer. If the tile can't be found in the local database it will show up blank (even if there is actual connectivity). The pair of methods `goOffline()` and `goOnline()` allows the developer to manually control the behaviour of the layer. Used in conjunction with the offline dectection library, you can put the layer in the appropriate mode when the internet condition changes.
####basemap.deleteAllTiles(callback)
#### basemap.deleteAllTiles(callback)
Deletes all tiles stored in the indexed db database.
The callback is called to indicate success (true) or failure (false,err)
####basemap.getOfflineUsage(callback)
#### basemap.getOfflineUsage(callback)
It calculates the number of tiles that are stored in the indexed db database and the space used by them. Because the library uses compression, the database size will be significantly smaller than the downloaded tiles size. The callback is called with an object containing the result of this calculation:
```js
@ -99,7 +99,7 @@ It calculates the number of tiles that are stored in the indexed db database and
size: /* total size of tiles */
}
```
####basemap.getTilePolygons(callback)
#### basemap.getTilePolygons(callback)
It calculates the geographic boundary of each of the tiles stored in the indexed db. This method calls the callback once for each tile, passing an esri/geometry/Polygon that can be added to a GraphicsLayer. This method is useful to show graphically which tiles are stored in the local database, like this:
```js
@ -115,7 +115,7 @@ It calculates the geographic boundary of each of the tiles stored in the indexed
}
}
```
####basemap.getLevelEstimation(extent, level, tileSize)
#### basemap.getLevelEstimation(extent, level, tileSize)
Returns an object that contains the number of tiles that would need to be downloaded for the specified extent and zoom level, and the estimated byte size of such tiles. This method is useful to give the user an indication of the required time and space before launching the actual download operation:
```js

View File

@ -1,10 +1,9 @@
Migrating from v1 to v2
=======================
# Migrating from v1 to v2
This doc is to provide pointers for migrating from offline-editor-js v1 to v2. Migration should be fairly straightforward as you are simply going to be changing library names and method namespaces. Check the CHANGELOG doc for specifics as well as any deprecations.
##Importing the libraries
## Importing the libraries
In your main html application you can use generic script injection to import the offline-editor-js libraries into your project. Don't create any aliases for the offline-editor-js libraries within the function statement and add them to the end of the module array, but before domReady. As you can see in the example below, the only alias is for `Map`.

View File

@ -1,16 +1,15 @@
API OfflineEditAdvanced
==================================
# API OfflineEditAdvanced
##O.esri.Edit.OfflineEditAdvanced
## O.esri.Edit.OfflineEditAdvanced
The `offline-edit-advanced-min.js` library provides the following tools for working with esri.layers.FeatureLayer objects while intermittently and fully offline.
###Constructor
### Constructor
Constructor | Description
--- | ---
`O.esri.Edit.OfflineEditAdvanced()` | Creates an instance of the OfflineEditAdvanced class. This library allows you to extend FeatureLayer objects with offline editing capabilities and manage the online/offline resynchronization process.
###Properties
### Properties
Property | Value | Description
--- | --- | ---
`DB_NAME` | "features_store" | Sets the database name. You can instantiate multiple databases within the same application by creating seperate instances of OfflineEditAdvanced.
@ -22,7 +21,7 @@ Property | Value | Description
`attachmentsStore` | null | Default is `null`. If you are using attachments, this property gives you access to the associated database.
`ENABLE_FEATURECOLLECTION` | `false` | Enabling this property will allow the library to create a snapshot of the feature layer and make it available via `getFeatureCollections()`. When you extend a layer and you want to use a custom `dataStore` then leave this property set to `false` so that you don't end up with two copies of the feature layer in the database.
###ENUMs
### ENUMs
The manager can be in one of these three states (see `getOnlineStatus()` method):
Property | Value | Description
@ -31,7 +30,7 @@ Property | Value | Description
`OFFLINE` | "offline" | Edits will be enqueued
`RECONNECTING` | "reconnecting" | Sending stored edits to the server
###Methods
### Methods
OfflineEditAdvanced provides the following functionality.
@ -47,7 +46,7 @@ Methods | Returns | Description
`getFeatureLayerJSONDataStore( callback )` | `callback( boolean, Object)` | (Added @ v2.7.1) Returns the feature layer's dataStore Object that was created using the `OfflineEditAdvanced()` constructor. Offers more control what is provided by `getFeatureCollections()`.
###Events
### Events
Application code can subscribe to OfflineEditAdvanced events to be notified of different conditions.
```js
@ -70,7 +69,7 @@ Event | Value | Returns | Description
`events.ATTACHMENT_ENQUEUED` | "attachment-enqueued" | nothing | An attachment is in the queue to be sent to the server.
`events.ATTACHMENTS_SENT` | "attachments-sent" | nothing | When any attachment is actually sent to the server.
###FeatureLayer
### FeatureLayer
A FeatureLayer that has been extended using OfflineEditAdvancedoff.extend() will gain access to the following additional functionality. Example usage:

View File

@ -1,16 +1,15 @@
API OfflineEditBasic
==================================
# API OfflineEditBasic
##O.esri.Edit.OfflineEditBasic
## O.esri.Edit.OfflineEditBasic
The `offline-edit-basic-min.js` library provides the following tools for working with esri.layers.FeatureLayer objects while intermittently offline.
###Constructor
### Constructor
Constructor | Description
--- | ---
`O.esri.Edit.OfflineEditBasic()` | Creates an instance of the OfflineEditBasic class. This library allows you to extend FeatureLayer objects with offline editing capabilities and manage the online/offline resynchronization process.
###Properties
### Properties
Property | Value | Description
--- | --- | ---
`DB_NAME` | "features_store" | Sets the database name. You can instantiate multiple databases within the same application by creating seperate instances of OfflineEditAdvanced.
@ -18,7 +17,7 @@ Property | Value | Description
`DB_UID` | "objectid" | IMPORTANT!** This tells the database what id to use as a unique identifier. This depends on how your feature service was created. ArcGIS Online services may use something different such as `GlobalID`.
`proxyPath` | null | Default is `null`. If you are using a Feature Service that is not CORS-enabled then you will need to set this path.
###ENUMs
### ENUMs
The manager can be in one of these three states (see `getOnlineStatus()` method):
Property | Value | Description
@ -27,7 +26,7 @@ Property | Value | Description
`OFFLINE` | "offline" | Edits will be enqueued
`RECONNECTING` | "reconnecting" | Sending stored edits to the server
###Methods
### Methods
OfflineEditBasic provides the following functionality.
@ -41,7 +40,7 @@ Methods | Returns | Description
`getOnlineStatus()` | `ONLINE`, `OFFLINE` or `RECONNECTING`| Determines the current state of the manager. Please, note that this library doesn't detect actual browser offline/online condition. You need to use the `offline.min.js` library included in `vendor\offline` directory to detect connection status and connect events to goOffline() and goOnline() methods. See `military-offline.html` sample.
###Events
### Events
Application code can subscribe to OfflineEditBasic events to be notified of different conditions.
```js
@ -61,7 +60,7 @@ Event | Value | Returns | Description
`events.EDITS_ENQUEUED_ERROR` | "edits-enqueued-error" | {msg:error} | An error occurred while trying to store the edit. In your app it is recommended to verify if the edit is in the database or not.
###FeatureLayer
### FeatureLayer
A FeatureLayer that has been extended using OfflineEditBasic.extend() will gain access to the following additional functionality. Example usage:

View File

@ -1,5 +1,4 @@
API Doc for OfflineTilesAdvanced
====================================
# API Doc for OfflineTilesAdvanced
There are two different libraries for taking tiles offline: `offline-tiles-basic-min.js` and `offline-tiles-advanced-min.js`. The basic library is for use with ArcGIS.com web maps and partial/intermittently offline use cases. You won't be able to restart or reload your app when using this library offline.
@ -7,21 +6,21 @@ If you have a requirement for restarting or reloading the app while offline then
If you have a requirement for using token-based security on your tiled map service then you'll need to use this library.
##O.esri.Tiles.OfflineTilesAdvanced
## O.esri.Tiles.OfflineTilesAdvanced
The `offline-tiles-advanced-min.js` library provides the following tools for working with tiled map services. This library is designed for both partial and full offline use cases, and it will work if you have a requirement for browser reloads or restarts while offline.
###Constructor
### Constructor
Constructor | Description
--- | ---
`O.esri.Tiles.OfflineTilesAdvanced(` `url,callback,state,dbConfig)` | Creates an instance of the offlineTilesAdvanced class. This library allows you to extend an ArcGISTiledMapServiceLayer with offline capability as well as manage the online/offline resynchronization process. Any Esri basemap REST endpoint should work. <br><br>The `state` property is a boolean for specifying if the application is intializing the layer online (true) or offline (false). It defaults to `true`. When you first load the map it is a best practice to set this property to `true`. <br><br>`dbConfig` is an optional object that can be used to customize the database name (`dbName`) and the object store (`objectStoreName`) name. Example: `{dbName: "TILES_TEST", objectStoreName: "TILES"}`.
###Properties
### Properties
Property | Value | Description
--- | --- | ---
`layer.showBlankTiles`| `true` | By default the library will show a 256x256 grey PNG image that says "NO TILE". To override this behavior, especially if you are using multiple tile layers and you don't want the grey "NO TILE" image to interfere then set this property to `false`.
`layer.offline.proxyPath`| `null` | The default is `null`. If you have a CORS-enabled service then use the default. Don't forget to check your proxy configuration to allow connections for all possible services that you might be using. More information on using proxies with ArcGIS can be found here: [https://developers.arcgis.com/javascript/jshelp/ags_proxy.html](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html).
###Methods
### Methods
Methods | Returns | Description
--- | --- | ---
`prepareForOffline(` `minLevel, maxLevel, extent, ` `reportProgress)` | `callback(number)` | Retrieves tiles and stores them in the local cache. For more information see [How To Use Tiles Library](howtousetiles.md).

View File

@ -1,25 +1,24 @@
API Doc for OfflineTilesBasic
===============================
# API Doc for OfflineTilesBasic
There are two different libraries for taking tiles offline: `offline-tiles-basic-min.js` and `offline-tiles-advanced-min.js`. The basic library is for use with ArcGIS.com web maps and partial/intermittently offline use cases. You won't be able to restart or reload your app when using this library offline.
If you have a requirement for restarting or reloading the app while offline then you should use the advanced library. The `offline-tiles-advanced-min.js` library lets you create a custom basemap layer that extends TiledMapServiceLayer.
##O.esri.Tiles.OfflineTilesBasic
## O.esri.Tiles.OfflineTilesBasic
The `offline-tiles-basic-min.js` library provides the following tools for working with with ArcGIS.com maps or tiled map services in partial-offline situations that don't require a browser restart or reload.
###Constructor
### Constructor
Constructor | Description
--- | ---
`O.esri.Tiles.OfflineTilesBasic()` | Creates an instance of the OfflineTilesBasic class. This library allows you to extend an ArcGISTiledMapServiceLayer with partial offline capability as well as manage the online/offline resynchronization process.
###Properties
### Properties
Property | Value | Description
--- | --- | ---
`layer.showBlankTiles`| `true` | By default the library will show a 256x256 grey PNG image that says "NO TILE". To override this behavior, especially if you are using multiple tile layers and you don't want the grey "NO TILE" image to interfere then set this property to `false`.
`layer.offline.proxyPath`| `null` | The default is `null`. If you have a CORS-enabled service then use the default. Don't forget to check your proxy configuration to allow connections for all possible services that you might be using. More information on using proxies with ArcGIS can be found here: [https://developers.arcgis.com/javascript/jshelp/ags_proxy.html](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html).
###Methods
### Methods
Methods | Returns | Description
--- | --- | ---
`extend(layer, callback, ` `state, dbConfig)`|`callback(boolean, string)` |Overrides an ArcGISTiledMapServiceLayer. Callback is called after indexedDB store is initialized and informs the application whether it is indexedDB is supported or not. <br><br>The `state` property is a boolean for specifying if the application is intializing the layer online (true) or offline (false). It defaults to `true`. When you first load the map it is a best practice to set this property to `true`. <br><br>`dbConfig` is an optional object that can be used to customize the database name (`dbName`) and the object store (`objectStoreName`) name. Example: `{dbName: "TILES_TEST", objectStoreName: "TILES"}`.

View File

@ -1,17 +1,16 @@
API Doc for TPKLayer
====================
# API Doc for TPKLayer
##O.esri.TPK.TPKLayer
## O.esri.TPK.TPKLayer
The `offline-tpk-min.js` library extends a tiled map service and provides the following tools for working with and displaying tiles from a .tpk file (ArcGIS Tile Package).
###Constructor
### Constructor
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.
###Properties
### Properties
Property | Value | Description
--- | --- | ---
`map` | Object | Refers to the main applications Esri.Map object.
@ -25,7 +24,7 @@ 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
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.
@ -35,20 +34,20 @@ Methods | Returns | Description
`loadFromURL(tile,callback)` | `callback(success,err)` | Use this method when working with both tiled map services and TPKs. With this method you can force load tiles into the database. Use this in conjunction with OfflineTilesBasic.saveToFile() and OfflineTilesAdvanced.saveToFile(). The `tile` property must confirm to the following Object construction: {/\* String \*/ url, /\* base64 String \*/ img}. Returns a boolean that indicates if the load was successful or not.
`isDBValid()` | boolean | Verifies whether not the browser supports this library.
###Events
### Events
Event | Value | Description
--- | --- | ---
`DATABASE_ERROR_EVENT` | "databaseErrorEvent" | An error occured while reading or writing to the local database.
`VALIDATION_EVENT` | "validationEvent" | An event related to various checks to insure library functionality is supported.
`PROGRESS_EVENT` | "progress" | Event indicated progress status while parsing a TPK file. Parsing can take a while depending on how large the TPK is.
###TiledMapServiceLayer Override
### TiledMapServiceLayer Override
Methods | Returns | Description
--- | --- | ---
`getTileUrl(level, row, col)` | String | Use the url's level, row and column to retrieve tiles as requested by the ArcGIS API for JavaScript. If a tile is in the local database it is returned. If it is not then the library parsing the TPK file for the appropriate tile image. If `isDBWriteable()` is set to true (default), then an image retrieved from the TPK will be written to the database. Tile retrieval times from images stored in the database are significantly faster than pulling images from the TPK.
###O.esri.zip
### O.esri.zip
Integrates zip.js into the TPKLayer library. Here is a short listing, for a completing listing of zip.js functionality go [here](http://gildas-lormeau.github.io/zip.js/).

View File

@ -1,20 +1,17 @@
##grunt-manifest
==============
## grunt-manifest
This library is used to help generate manifest files and it is licensed under the MIT/X11 license.
Visit [here](https://github.com/gunta/grunt-manifest/blob/master/LICENSE-MIT) for a copy of the license. Or visit @guntas repo at: [https://github.com/gunta/grunt-manifest](https://github.com/gunta/grunt-manifest)
##zip.js
========
## zip.js
A library for zipping and unzipping files.
Visit [here](https://github.com/gildas-lormeau/zip.js) for BSD licensing information.
##DataStream.js
===============
## DataStream.js
A library for working with binary data.