Skip to content

Commit cac24b5

Browse files
committed
Publish new version
1 parent b4f9f9d commit cac24b5

39 files changed

+564
-551
lines changed

build/geo-three.cjs

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@ Object.defineProperty(exports, '__esModule', { value: true });
44

55
var three = require('three');
66

7+
/*! *****************************************************************************
8+
Copyright (c) Microsoft Corporation.
9+
10+
Permission to use, copy, modify, and/or distribute this software for any
11+
purpose with or without fee is hereby granted.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19+
PERFORMANCE OF THIS SOFTWARE.
20+
***************************************************************************** */
21+
22+
function __awaiter(thisArg, _arguments, P, generator) {
23+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24+
return new (P || (P = Promise))(function (resolve, reject) {
25+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
26+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
27+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
28+
step((generator = generator.apply(thisArg, _arguments || [])).next());
29+
});
30+
}
31+
732
class MapProvider {
833
constructor() {
934
this.name = '';
@@ -15,7 +40,9 @@ class MapProvider {
1540
fetchTile(zoom, x, y) {
1641
return null;
1742
}
18-
getMetaData() { }
43+
getMetaData() {
44+
return __awaiter(this, void 0, void 0, function* () { });
45+
}
1946
}
2047

2148
class OpenStreetMapsProvider extends MapProvider {
@@ -40,31 +67,6 @@ class OpenStreetMapsProvider extends MapProvider {
4067
}
4168
}
4269

43-
/*! *****************************************************************************
44-
Copyright (c) Microsoft Corporation.
45-
46-
Permission to use, copy, modify, and/or distribute this software for any
47-
purpose with or without fee is hereby granted.
48-
49-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
55-
PERFORMANCE OF THIS SOFTWARE.
56-
***************************************************************************** */
57-
58-
function __awaiter(thisArg, _arguments, P, generator) {
59-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
60-
return new (P || (P = Promise))(function (resolve, reject) {
61-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
62-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
63-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
64-
step((generator = generator.apply(thisArg, _arguments || [])).next());
65-
});
66-
}
67-
6870
class CanvasUtils {
6971
static createOffscreenCanvas(width, height) {
7072
if (typeof OffscreenCanvas !== 'undefined') {
@@ -1455,35 +1457,33 @@ class LODFrustum extends LODRadial {
14551457
}
14561458

14571459
class XHRUtils {
1458-
static get(url, onLoad, onError) {
1459-
const xhr = new XMLHttpRequest();
1460-
xhr.overrideMimeType('text/plain');
1461-
xhr.open('GET', url, true);
1462-
if (onLoad !== undefined) {
1463-
xhr.onload = function () {
1464-
onLoad(xhr.response);
1465-
};
1466-
}
1467-
if (onError !== undefined) {
1468-
xhr.onerror = onError;
1469-
}
1470-
xhr.send(null);
1471-
return xhr;
1460+
static get(url) {
1461+
return __awaiter(this, void 0, void 0, function* () {
1462+
return new Promise(function (resolve, reject) {
1463+
const xhr = new XMLHttpRequest();
1464+
xhr.overrideMimeType('text/plain');
1465+
xhr.open('GET', url, true);
1466+
xhr.onload = function () {
1467+
resolve(xhr.response);
1468+
};
1469+
xhr.onerror = reject;
1470+
xhr.send(null);
1471+
});
1472+
});
14721473
}
1473-
static getRaw(url, onLoad, onError) {
1474-
var xhr = new XMLHttpRequest();
1475-
xhr.responseType = 'arraybuffer';
1476-
xhr.open('GET', url, true);
1477-
if (onLoad !== undefined) {
1478-
xhr.onload = function () {
1479-
onLoad(xhr.response);
1480-
};
1481-
}
1482-
if (onError !== undefined) {
1483-
xhr.onerror = onError;
1484-
}
1485-
xhr.send(null);
1486-
return xhr;
1474+
static getRaw(url) {
1475+
return __awaiter(this, void 0, void 0, function* () {
1476+
return new Promise(function (resolve, reject) {
1477+
var xhr = new XMLHttpRequest();
1478+
xhr.responseType = 'arraybuffer';
1479+
xhr.open('GET', url, true);
1480+
xhr.onload = function () {
1481+
resolve(xhr.response);
1482+
};
1483+
xhr.onerror = reject;
1484+
xhr.send(null);
1485+
});
1486+
});
14871487
}
14881488
static request(url, type, header, body, onLoad, onError, onProgress) {
14891489
function parseResponse(response) {
@@ -1526,13 +1526,15 @@ class BingMapsProvider extends MapProvider {
15261526
this.format = 'jpeg';
15271527
this.mapSize = 512;
15281528
this.subdomain = 't1';
1529+
this.meta = null;
15291530
this.apiKey = apiKey;
15301531
this.type = type;
15311532
}
15321533
getMetaData() {
1533-
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1534-
XHRUtils.get(address, function (data) {
1535-
JSON.parse(data);
1534+
return __awaiter(this, void 0, void 0, function* () {
1535+
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1536+
const data = yield XHRUtils.get(address);
1537+
this.meta = JSON.parse(data);
15361538
});
15371539
}
15381540
static quadKey(zoom, x, y) {
@@ -1628,7 +1630,9 @@ class HereMapsProvider extends MapProvider {
16281630
nextServer() {
16291631
this.server = this.server % 4 === 0 ? 1 : this.server + 1;
16301632
}
1631-
getMetaData() { }
1633+
getMetaData() {
1634+
return __awaiter(this, void 0, void 0, function* () { });
1635+
}
16321636
fetchTile(zoom, x, y) {
16331637
this.nextServer();
16341638
return new Promise((resolve, reject) => {
@@ -1660,8 +1664,9 @@ class MapBoxProvider extends MapProvider {
16601664
this.version = version;
16611665
}
16621666
getMetaData() {
1663-
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
1664-
XHRUtils.get(address, (data) => {
1667+
return __awaiter(this, void 0, void 0, function* () {
1668+
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
1669+
const data = yield XHRUtils.get(address);
16651670
const meta = JSON.parse(data);
16661671
this.name = meta.name;
16671672
this.minZoom = meta.minZoom;
@@ -1725,8 +1730,9 @@ class OpenMapTilesProvider extends MapProvider {
17251730
this.theme = theme;
17261731
}
17271732
getMetaData() {
1728-
const address = this.address + 'styles/' + this.theme + '.json';
1729-
XHRUtils.get(address, (data) => {
1733+
return __awaiter(this, void 0, void 0, function* () {
1734+
const address = this.address + 'styles/' + this.theme + '.json';
1735+
const data = yield XHRUtils.get(address);
17301736
const meta = JSON.parse(data);
17311737
this.name = meta.name;
17321738
this.format = meta.format;

build/geo-three.js

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@
44
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Geo = {}, global.THREE));
55
})(this, (function (exports, three) { 'use strict';
66

7+
/*! *****************************************************************************
8+
Copyright (c) Microsoft Corporation.
9+
10+
Permission to use, copy, modify, and/or distribute this software for any
11+
purpose with or without fee is hereby granted.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19+
PERFORMANCE OF THIS SOFTWARE.
20+
***************************************************************************** */
21+
22+
function __awaiter(thisArg, _arguments, P, generator) {
23+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24+
return new (P || (P = Promise))(function (resolve, reject) {
25+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
26+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
27+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
28+
step((generator = generator.apply(thisArg, _arguments || [])).next());
29+
});
30+
}
31+
732
class MapProvider {
833
constructor() {
934
this.name = '';
@@ -15,7 +40,9 @@
1540
fetchTile(zoom, x, y) {
1641
return null;
1742
}
18-
getMetaData() { }
43+
getMetaData() {
44+
return __awaiter(this, void 0, void 0, function* () { });
45+
}
1946
}
2047

2148
class OpenStreetMapsProvider extends MapProvider {
@@ -40,31 +67,6 @@
4067
}
4168
}
4269

43-
/*! *****************************************************************************
44-
Copyright (c) Microsoft Corporation.
45-
46-
Permission to use, copy, modify, and/or distribute this software for any
47-
purpose with or without fee is hereby granted.
48-
49-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
55-
PERFORMANCE OF THIS SOFTWARE.
56-
***************************************************************************** */
57-
58-
function __awaiter(thisArg, _arguments, P, generator) {
59-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
60-
return new (P || (P = Promise))(function (resolve, reject) {
61-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
62-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
63-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
64-
step((generator = generator.apply(thisArg, _arguments || [])).next());
65-
});
66-
}
67-
6870
class CanvasUtils {
6971
static createOffscreenCanvas(width, height) {
7072
if (typeof OffscreenCanvas !== 'undefined') {
@@ -1455,35 +1457,33 @@
14551457
}
14561458

14571459
class XHRUtils {
1458-
static get(url, onLoad, onError) {
1459-
const xhr = new XMLHttpRequest();
1460-
xhr.overrideMimeType('text/plain');
1461-
xhr.open('GET', url, true);
1462-
if (onLoad !== undefined) {
1463-
xhr.onload = function () {
1464-
onLoad(xhr.response);
1465-
};
1466-
}
1467-
if (onError !== undefined) {
1468-
xhr.onerror = onError;
1469-
}
1470-
xhr.send(null);
1471-
return xhr;
1460+
static get(url) {
1461+
return __awaiter(this, void 0, void 0, function* () {
1462+
return new Promise(function (resolve, reject) {
1463+
const xhr = new XMLHttpRequest();
1464+
xhr.overrideMimeType('text/plain');
1465+
xhr.open('GET', url, true);
1466+
xhr.onload = function () {
1467+
resolve(xhr.response);
1468+
};
1469+
xhr.onerror = reject;
1470+
xhr.send(null);
1471+
});
1472+
});
14721473
}
1473-
static getRaw(url, onLoad, onError) {
1474-
var xhr = new XMLHttpRequest();
1475-
xhr.responseType = 'arraybuffer';
1476-
xhr.open('GET', url, true);
1477-
if (onLoad !== undefined) {
1478-
xhr.onload = function () {
1479-
onLoad(xhr.response);
1480-
};
1481-
}
1482-
if (onError !== undefined) {
1483-
xhr.onerror = onError;
1484-
}
1485-
xhr.send(null);
1486-
return xhr;
1474+
static getRaw(url) {
1475+
return __awaiter(this, void 0, void 0, function* () {
1476+
return new Promise(function (resolve, reject) {
1477+
var xhr = new XMLHttpRequest();
1478+
xhr.responseType = 'arraybuffer';
1479+
xhr.open('GET', url, true);
1480+
xhr.onload = function () {
1481+
resolve(xhr.response);
1482+
};
1483+
xhr.onerror = reject;
1484+
xhr.send(null);
1485+
});
1486+
});
14871487
}
14881488
static request(url, type, header, body, onLoad, onError, onProgress) {
14891489
function parseResponse(response) {
@@ -1526,13 +1526,15 @@
15261526
this.format = 'jpeg';
15271527
this.mapSize = 512;
15281528
this.subdomain = 't1';
1529+
this.meta = null;
15291530
this.apiKey = apiKey;
15301531
this.type = type;
15311532
}
15321533
getMetaData() {
1533-
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1534-
XHRUtils.get(address, function (data) {
1535-
JSON.parse(data);
1534+
return __awaiter(this, void 0, void 0, function* () {
1535+
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1536+
const data = yield XHRUtils.get(address);
1537+
this.meta = JSON.parse(data);
15361538
});
15371539
}
15381540
static quadKey(zoom, x, y) {
@@ -1628,7 +1630,9 @@
16281630
nextServer() {
16291631
this.server = this.server % 4 === 0 ? 1 : this.server + 1;
16301632
}
1631-
getMetaData() { }
1633+
getMetaData() {
1634+
return __awaiter(this, void 0, void 0, function* () { });
1635+
}
16321636
fetchTile(zoom, x, y) {
16331637
this.nextServer();
16341638
return new Promise((resolve, reject) => {
@@ -1660,8 +1664,9 @@
16601664
this.version = version;
16611665
}
16621666
getMetaData() {
1663-
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
1664-
XHRUtils.get(address, (data) => {
1667+
return __awaiter(this, void 0, void 0, function* () {
1668+
const address = MapBoxProvider.ADDRESS + this.version + '/' + this.mapId + '.json?access_token=' + this.apiToken;
1669+
const data = yield XHRUtils.get(address);
16651670
const meta = JSON.parse(data);
16661671
this.name = meta.name;
16671672
this.minZoom = meta.minZoom;
@@ -1725,8 +1730,9 @@
17251730
this.theme = theme;
17261731
}
17271732
getMetaData() {
1728-
const address = this.address + 'styles/' + this.theme + '.json';
1729-
XHRUtils.get(address, (data) => {
1733+
return __awaiter(this, void 0, void 0, function* () {
1734+
const address = this.address + 'styles/' + this.theme + '.json';
1735+
const data = yield XHRUtils.get(address);
17301736
const meta = JSON.parse(data);
17311737
this.name = meta.name;
17321738
this.format = meta.format;

0 commit comments

Comments
 (0)