Esri / offline-editor-js

ArcGIS JavaScript library for handling offline editing and tiling.
http://esri.github.io/offline-editor-js/demo/
Apache License 2.0
159 stars 142 forks source link

Do OfflineTileEnablerLayer support secured map services? #411

Closed Elhazard closed 9 years ago

Elhazard commented 9 years ago

Hi

Yesterday, I try to create a basemap using OfflineTileEnablerLayer by something like this

var basemapLayer = new O.esri.Tiles.OfflineTileEnablerLayer("https://map.nostramap.com/arcgis/rest/services/StreetMapEn/MapServer?token=oj9G9dQBfk2XsRORPb1rKBB_DG-a-YJy7F20zXRsJMlIs-g7hHv6JCGIDgVOJ7Th");

As a secured map service, this needs a token in order to access. However, it returns an error "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" and cannot initialize basemap object.

Somehow, this map service still works well if I simply use "ArcGISTiledMapServiceLayer" to new MapLayer object.

So I wonder is there any difference between OfflineTileEnablerLayer and ArcGISTiledMapServiceLayer that make OfflineTileEnablerLayer cannot use secured map services?

Thanks

andygup commented 9 years ago

@Elhazard This is related to #291 and needs to be fixed in both offlineTilesEnabler and OfflineTilesEnablerLayer.

I'll take a deeper look at the code to see what is involved to fix this.

Elhazard commented 9 years ago

Thanks for the info. I will tell my supervisor about this

andygup commented 9 years ago

@Elhazard I have an old branch that I'll test and see if it works still. If it does I'll cut a new release. Please note that it will cause a breaking change if you are hosting the Esri JS Library locally because it will now need to include esri/IdentityManager

andygup commented 9 years ago

Closed via https://github.com/Esri/offline-editor-js/commit/9552ba1567ee0716844fc78cc5cec2f62538bb50