Skip to content

Commit

Permalink
Publish new version
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Dec 20, 2022
1 parent b4f9f9d commit cac24b5
Show file tree
Hide file tree
Showing 39 changed files with 564 additions and 551 deletions.
130 changes: 68 additions & 62 deletions build/geo-three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ Object.defineProperty(exports, '__esModule', { value: true });

var three = require('three');

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}

class MapProvider {
constructor() {
this.name = '';
Expand All @@ -15,7 +40,9 @@ class MapProvider {
fetchTile(zoom, x, y) {
return null;
}
getMetaData() { }
getMetaData() {
return __awaiter(this, void 0, void 0, function* () { });
}
}

class OpenStreetMapsProvider extends MapProvider {
Expand All @@ -40,31 +67,6 @@ class OpenStreetMapsProvider extends MapProvider {
}
}

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}

class CanvasUtils {
static createOffscreenCanvas(width, height) {
if (typeof OffscreenCanvas !== 'undefined') {
Expand Down Expand Up @@ -1455,35 +1457,33 @@ class LODFrustum extends LODRadial {
}

class XHRUtils {
static get(url, onLoad, onError) {
const xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, true);
if (onLoad !== undefined) {
xhr.onload = function () {
onLoad(xhr.response);
};
}
if (onError !== undefined) {
xhr.onerror = onError;
}
xhr.send(null);
return xhr;
static get(url) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, true);
xhr.onload = function () {
resolve(xhr.response);
};
xhr.onerror = reject;
xhr.send(null);
});
});
}
static getRaw(url, onLoad, onError) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', url, true);
if (onLoad !== undefined) {
xhr.onload = function () {
onLoad(xhr.response);
};
}
if (onError !== undefined) {
xhr.onerror = onError;
}
xhr.send(null);
return xhr;
static getRaw(url) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', url, true);
xhr.onload = function () {
resolve(xhr.response);
};
xhr.onerror = reject;
xhr.send(null);
});
});
}
static request(url, type, header, body, onLoad, onError, onProgress) {
function parseResponse(response) {
Expand Down Expand Up @@ -1526,13 +1526,15 @@ class BingMapsProvider extends MapProvider {
this.format = 'jpeg';
this.mapSize = 512;
this.subdomain = 't1';
this.meta = null;
this.apiKey = apiKey;
this.type = type;
}
getMetaData() {
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
XHRUtils.get(address, function (data) {
JSON.parse(data);
return __awaiter(this, void 0, void 0, function* () {
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
const data = yield XHRUtils.get(address);
this.meta = JSON.parse(data);
});
}
static quadKey(zoom, x, y) {
Expand Down Expand Up @@ -1628,7 +1630,9 @@ class HereMapsProvider extends MapProvider {
nextServer() {
this.server = this.server % 4 === 0 ? 1 : this.server + 1;
}
getMetaData() { }
getMetaData() {
return __awaiter(this, void 0, void 0, function* () { });
}
fetchTile(zoom, x, y) {
this.nextServer();
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -1660,8 +1664,9 @@ class MapBoxProvider extends MapProvider {
this.version = version;
}
getMetaData() {
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
XHRUtils.get(address, (data) => {
return __awaiter(this, void 0, void 0, function* () {
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
const data = yield XHRUtils.get(address);
const meta = JSON.parse(data);
this.name = meta.name;
this.minZoom = meta.minZoom;
Expand Down Expand Up @@ -1725,8 +1730,9 @@ class OpenMapTilesProvider extends MapProvider {
this.theme = theme;
}
getMetaData() {
const address = this.address + 'styles/' + this.theme + '.json';
XHRUtils.get(address, (data) => {
return __awaiter(this, void 0, void 0, function* () {
const address = this.address + 'styles/' + this.theme + '.json';
const data = yield XHRUtils.get(address);
const meta = JSON.parse(data);
this.name = meta.name;
this.format = meta.format;
Expand Down
130 changes: 68 additions & 62 deletions build/geo-three.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Geo = {}, global.THREE));
})(this, (function (exports, three) { 'use strict';

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}

class MapProvider {
constructor() {
this.name = '';
Expand All @@ -15,7 +40,9 @@
fetchTile(zoom, x, y) {
return null;
}
getMetaData() { }
getMetaData() {
return __awaiter(this, void 0, void 0, function* () { });
}
}

class OpenStreetMapsProvider extends MapProvider {
Expand All @@ -40,31 +67,6 @@
}
}

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}

class CanvasUtils {
static createOffscreenCanvas(width, height) {
if (typeof OffscreenCanvas !== 'undefined') {
Expand Down Expand Up @@ -1455,35 +1457,33 @@
}

class XHRUtils {
static get(url, onLoad, onError) {
const xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, true);
if (onLoad !== undefined) {
xhr.onload = function () {
onLoad(xhr.response);
};
}
if (onError !== undefined) {
xhr.onerror = onError;
}
xhr.send(null);
return xhr;
static get(url) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.overrideMimeType('text/plain');
xhr.open('GET', url, true);
xhr.onload = function () {
resolve(xhr.response);
};
xhr.onerror = reject;
xhr.send(null);
});
});
}
static getRaw(url, onLoad, onError) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', url, true);
if (onLoad !== undefined) {
xhr.onload = function () {
onLoad(xhr.response);
};
}
if (onError !== undefined) {
xhr.onerror = onError;
}
xhr.send(null);
return xhr;
static getRaw(url) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', url, true);
xhr.onload = function () {
resolve(xhr.response);
};
xhr.onerror = reject;
xhr.send(null);
});
});
}
static request(url, type, header, body, onLoad, onError, onProgress) {
function parseResponse(response) {
Expand Down Expand Up @@ -1526,13 +1526,15 @@
this.format = 'jpeg';
this.mapSize = 512;
this.subdomain = 't1';
this.meta = null;
this.apiKey = apiKey;
this.type = type;
}
getMetaData() {
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
XHRUtils.get(address, function (data) {
JSON.parse(data);
return __awaiter(this, void 0, void 0, function* () {
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
const data = yield XHRUtils.get(address);
this.meta = JSON.parse(data);
});
}
static quadKey(zoom, x, y) {
Expand Down Expand Up @@ -1628,7 +1630,9 @@
nextServer() {
this.server = this.server % 4 === 0 ? 1 : this.server + 1;
}
getMetaData() { }
getMetaData() {
return __awaiter(this, void 0, void 0, function* () { });
}
fetchTile(zoom, x, y) {
this.nextServer();
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -1660,8 +1664,9 @@
this.version = version;
}
getMetaData() {
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
XHRUtils.get(address, (data) => {
return __awaiter(this, void 0, void 0, function* () {
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
const data = yield XHRUtils.get(address);
const meta = JSON.parse(data);
this.name = meta.name;
this.minZoom = meta.minZoom;
Expand Down Expand Up @@ -1725,8 +1730,9 @@
this.theme = theme;
}
getMetaData() {
const address = this.address + 'styles/' + this.theme + '.json';
XHRUtils.get(address, (data) => {
return __awaiter(this, void 0, void 0, function* () {
const address = this.address + 'styles/' + this.theme + '.json';
const data = yield XHRUtils.get(address);
const meta = JSON.parse(data);
this.name = meta.name;
this.format = meta.format;
Expand Down
Loading

0 comments on commit cac24b5

Please sign in to comment.