<commit_before>API Doc for TPKLayer
====================

##TPKLayer

Extends a tiled map service and provides the ability to display tiles from a .tpk (ArcGIS Tile Page).

###Constructor

Constructor | Description
--- | ---
`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
--- | --- | ---
`map` | Object | Refers to the main applications Esri.Map object.
`store` | Object |  Refers to the local database and hooks directly to its [functionality](offlinetilesenabler.md). 
`RECENTER_DELAY` | 350 | Default is 350ms. Millisecond delay before attempting to recenter the map after orientation changes. Note: adjusting this too high will cause annoying delays. Adjusting this to short and it may not fire properly within the application life cycle.	
`PROGRESS_START` | "start" | Parsing has begun. Important for control UX elements that provide user feedback during parsing.
`PROGRESS_END` | "end" | Parsing has finished. Important for control UX elements that provide user feedback during parsing.
`WINDOW_VALIDATED` | "windowValidated" | All window related functionality has been checked. Example: Window.File and Window.FileReader.
`DB_VALIDATED` | "dbValidated" | All database checks have passed.

###Events
Event | Value | Description
--- | --- | ---
`DATABASE_ERROR` | "databaseError" | An error occured while reading or writing to the local database.
`PARSING_ERROR` | "parsingError" | An error occured while parsing the TPK file.
`DB_INIT_ERROR` | "dbInitError"| An error occurred while initializing the database.
`NO_SUPPORT_ERROR` | "libNotSupportedError"| The library won't work on this browser.
`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.<commit_msg>fixed grammer in doc<commit_after>API Doc for TPKLayer
====================

##TPKLayer

Extends a tiled map service and provides the ability to display tiles from a .tpk (ArcGIS Tile Page).

###Constructor

Constructor | Description
--- | ---
`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
--- | --- | ---
`map` | Object | Refers to the main applications Esri.Map object.
`store` | Object |  Refers to the local database and hooks directly to its [functionality](offlinetilesenabler.md). 
`RECENTER_DELAY` | 350 | Default is 350ms. Millisecond delay before attempting to recenter the map after orientation changes. Note: adjusting this too high will cause annoying delays. Adjusting this to short and it may not fire properly within the application life cycle.	
`PROGRESS_START` | "start" | Parsing has begun. Important for control of UX elements that provide user feedback during parsing.
`PROGRESS_END` | "end" | Parsing has finished. Important for control of UX elements that provide user feedback during parsing.
`WINDOW_VALIDATED` | "windowValidated" | All window related functionality has been checked. Example: Window.File and Window.FileReader.
`DB_VALIDATED` | "dbValidated" | All database checks have passed.

###Events
Event | Value | Description
--- | --- | ---
`DATABASE_ERROR` | "databaseError" | An error occured while reading or writing to the local database.
`PARSING_ERROR` | "parsingError" | An error occured while parsing the TPK file.
`DB_INIT_ERROR` | "dbInitError"| An error occurred while initializing the database.
`NO_SUPPORT_ERROR` | "libNotSupportedError"| The library won't work on this browser.
`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.
{'fraction_non_alphanumeric': 0.07800215816247881, 'fraction_numerical': 0.0033913981809773393, 'mean_word_length': 4.661431064572426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4176907', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1631, 'n_words': 862}