renamed offlineEnabler to offlineTilesEnabler

This commit is contained in:
Javier Abadia 2014-02-18 00:16:10 +01:00
parent 817a23a07e
commit 8d7ef26efc
5 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@ This repo contains two sets of libraries:
* `offlineFeaturesManager` - Extends and overrides a feature layer.
* `editsStore` - Provides static helper methods for working with the offline data store.
- `/tiles`: stores portions of tiled maps client-side and uses the cached tiles when device is offline
* `offlineEnabler` Extends and overrides a tiled map service.
* `offlineTilesEnabler` Extends and overrides a tiled map service.
##Workflows Supported (v1)
The following workflow is currently supported for both both features and tiles:
@ -77,7 +77,7 @@ Methods | Returns | Description
`getLocalStorageSizeBytes()` | Number | Returns the total size of all items in bytes for local storage cached using the current domain name.
##offlineEnabler
##offlineTilesEnabler
Extends and overrides a tiled map service.
###Methods
@ -123,12 +123,12 @@ The `tiles` library allows a developer to extend a tiled layer with offline supp
```
**Step 2** Include the `tiles/offlineEnabler` library in your app.
**Step 2** Include the `tiles/offlineTilesEnabler` library in your app.
```js
require([
"esri/map",
"tiles/offlineEnabler"],
function(Map,offlineEnabler)
"tiles/offlineTilesEnabler"],
function(Map,offlineTilesEnabler)
{
...
});
@ -136,7 +136,7 @@ The `tiles` library allows a developer to extend a tiled layer with offline supp
**Step 3** Once your map is created (either using new Map() or using esriUtils.createMap(webmapid,...), you extend the basemap layer with the offline functionality
```js
var basemapLayer = map.getLayer( map.layerIds[0] );
offlineEnabler.extend(basemapLayer,function(success)
offlineTilesEnabler.extend(basemapLayer,function(success)
{
if(success) {
// Now we can use offline functionality on this layer
@ -223,7 +223,7 @@ It calculates the geographic boundary of each of the tiles stored in the indexed
The `edit` library allows a developer to extend a feature layer with offline editing support.
**Step 1** Include `offline.min.js` and `tiles/offlineEnabler` in your app.
**Step 1** Include `offline.min.js` and `tiles/offlineTilesEnabler` in your app.
```html
<script src="../vendor/offline/offline.min.js"></script>
<script>

View File

@ -294,7 +294,7 @@ require(["esri/map",
"dojo/dom", "dojo/on", "dojo/query",
"vendor/bootstrap-map-js/src/js/bootstrapmap",
"esri/urlUtils", "esri/geometry/webMercatorUtils",
"tiles/offlineEnabler","utils/debouncer",
"tiles/offlineTilesEnabler","utils/debouncer",
"dojo/dom-construct", "dojo/domReady!"],
function(Map,
GraphicsLayer, Graphic, SimpleFillSymbol,
@ -302,7 +302,7 @@ require(["esri/map",
dom, on, query,
BootstrapMap,
urlUtils, webMercatorUtils,
offlineEnabler,debouncer,
offlineTilesEnabler,debouncer,
domConstruct)
{
var scalebar;
@ -409,7 +409,7 @@ require(["esri/map",
{
console.log("extending");
offlineEnabler.extend(basemapLayer,function(success)
offlineTilesEnabler.extend(basemapLayer,function(success)
{
if(success)
{

View File

@ -21,27 +21,27 @@
<script src="http://js.arcgis.com/3.6/"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="spec/offlineEnablerSpec.js"></script>
<script type="text/javascript" src="spec/offlineTilesEnablerSpec.js"></script>
<script type="text/javascript">
var g_map;
var g_basemapLayer;
var g_offlineEnabler;
var g_offlineTilesEnabler;
require(["esri/map",
"esri/layers/GraphicsLayer", "esri/graphic", "esri/symbols/SimpleFillSymbol",
"esri/dijit/Scalebar", "esri/arcgis/utils", "esri/geometry",
"dojo/dom", "dojo/on", "dojo/query",
"esri/urlUtils", "esri/geometry/webMercatorUtils",
"tiles/offlineEnabler",
"tiles/offlineTilesEnabler",
"dojo/dom-construct", "dojo/domReady!"],
function(Map,
GraphicsLayer, Graphic, SimpleFillSymbol,
Scalebar, esriUtils, geometry,
dom, on, query,
urlUtils, webMercatorUtils,
offlineEnabler,
offlineTilesEnabler,
domConstruct)
{
g_map = new Map("map", {
@ -56,7 +56,7 @@
function test()
{
g_basemapLayer = g_map.getLayer( g_map.layerIds[0] );
g_offlineEnabler = offlineEnabler;
g_offlineTilesEnabler = offlineTilesEnabler;
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;

View File

@ -21,7 +21,7 @@ describe("offline enabler library", function()
async.it("extends the tiled layer object", function(done)
{
expect(g_basemapLayer.goOffline).toBeUndefined();
g_offlineEnabler.extend(g_basemapLayer,function(success)
g_offlineTilesEnabler.extend(g_basemapLayer,function(success)
{
expect(success).toEqual(true);
expect(g_basemapLayer.goOffline).toEqual(jasmine.any(Function));