mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
fixed reference to local tpk file. Eliminates cross-origin issues, etc
This commit is contained in:
parent
01b0d3ba43
commit
f0836df37c
@ -102,7 +102,7 @@
|
||||
<div id="header-div">
|
||||
<div id="input-container">
|
||||
<input type="file" id="file-input" name="files[]" accept="application/zip"/>
|
||||
<input type="text" id="url-input" value="http://andygup.github.io/tpk-layer-js/Beirut.zip" />
|
||||
<input type="text" id="url-input" value="tpks/Beirut.zip" />
|
||||
<button id="url-btn">Get file via url</button>
|
||||
</div>
|
||||
<div id="header-title">TPKLayer demo</div>
|
||||
@ -138,7 +138,9 @@
|
||||
* Parse zipped TPK file and get the individual files.
|
||||
*/
|
||||
function zipParser(blob){
|
||||
zip.workerScriptsPath = "lib/tpk/"; //tell zip.js where to find it's associated scripts
|
||||
|
||||
//IMPORTANT!
|
||||
zip.workerScriptsPath = locationPath + "/../lib/tpk/"; //tell zip.js where to find it's associated scripts
|
||||
|
||||
zip.createReader(new zip.BlobReader(blob), function (zipReader) {
|
||||
zipReader.getEntries(function (entries) {
|
||||
@ -186,7 +188,7 @@
|
||||
urlInputBtn = document.getElementById("url-btn");
|
||||
urlInputBtn.onclick = function(){
|
||||
var xhrRequest = new XMLHttpRequest();
|
||||
xhrRequest.open("GET", "../lib/resource-proxy/proxy.php?" + url.value, true);
|
||||
xhrRequest.open("GET", url.value, true);
|
||||
xhrRequest.responseType = "blob";
|
||||
xhrRequest.onprogress = function(evt){
|
||||
loading.style.visibility = "visible";
|
||||
@ -195,6 +197,8 @@
|
||||
console.log("Begin downloading remote tpk file...")
|
||||
}
|
||||
|
||||
xhrRequest.error = function(err){console.log("ERRROR")}
|
||||
|
||||
xhrRequest.onload = function(oEvent) {
|
||||
if(this.status == 200) {
|
||||
loading.style.visibility = "hidden";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user