From 9ad8dbc3788c1c5adfbb278ffbf12746e4d87631 Mon Sep 17 00:00:00 2001 From: tentone Date: Fri, 11 Nov 2022 11:36:52 +0000 Subject: [PATCH] Update build --- build/geo-three.cjs | 14 +++++--------- build/geo-three.js | 14 +++++--------- build/geo-three.module.js | 14 +++++--------- build/providers/BingMapsProvider.d.ts | 1 + package.json | 2 +- 5 files changed, 17 insertions(+), 28 deletions(-) diff --git a/build/geo-three.cjs b/build/geo-three.cjs index 5fced00..50c143a 100644 --- a/build/geo-three.cjs +++ b/build/geo-three.cjs @@ -180,7 +180,7 @@ class MapNodeGeometry extends three.BufferGeometry { class CanvasUtils { static createOffscreenCanvas(width, height) { - if (OffscreenCanvas) { + if (typeof OffscreenCanvas !== 'undefined') { return new OffscreenCanvas(width, height); } else { @@ -320,7 +320,7 @@ class UnitsUtils { return { latitude: latitude, longitude: longitude }; } } -UnitsUtils.EARTH_RADIUS = 6378137; +UnitsUtils.EARTH_RADIUS = 6371008; UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS; UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0; @@ -1398,12 +1398,7 @@ class XHRUtils { if (onProgress !== undefined) { xhr.onprogress = onProgress; } - if (body !== undefined) { - xhr.send(body); - } - else { - xhr.send(null); - } + xhr.send(body !== undefined ? body : null); return xhr; } } @@ -1420,7 +1415,7 @@ class BingMapsProvider extends MapProvider { this.maxZoom = 19; } getMetaData() { - const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; + const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; XHRUtils.get(address, function (data) { JSON.parse(data); }); @@ -1454,6 +1449,7 @@ class BingMapsProvider extends MapProvider { }); } } +BingMapsProvider.ADDRESS = "https://dev.virtualearth.net"; BingMapsProvider.AERIAL = 'a'; BingMapsProvider.ROAD = 'r'; BingMapsProvider.AERIAL_LABELS = 'h'; diff --git a/build/geo-three.js b/build/geo-three.js index ed43eff..a01bb6d 100644 --- a/build/geo-three.js +++ b/build/geo-three.js @@ -180,7 +180,7 @@ class CanvasUtils { static createOffscreenCanvas(width, height) { - if (OffscreenCanvas) { + if (typeof OffscreenCanvas !== 'undefined') { return new OffscreenCanvas(width, height); } else { @@ -320,7 +320,7 @@ return { latitude: latitude, longitude: longitude }; } } - UnitsUtils.EARTH_RADIUS = 6378137; + UnitsUtils.EARTH_RADIUS = 6371008; UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS; UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0; @@ -1398,12 +1398,7 @@ if (onProgress !== undefined) { xhr.onprogress = onProgress; } - if (body !== undefined) { - xhr.send(body); - } - else { - xhr.send(null); - } + xhr.send(body !== undefined ? body : null); return xhr; } } @@ -1420,7 +1415,7 @@ this.maxZoom = 19; } getMetaData() { - const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; + const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; XHRUtils.get(address, function (data) { JSON.parse(data); }); @@ -1454,6 +1449,7 @@ }); } } + BingMapsProvider.ADDRESS = "https://dev.virtualearth.net"; BingMapsProvider.AERIAL = 'a'; BingMapsProvider.ROAD = 'r'; BingMapsProvider.AERIAL_LABELS = 'h'; diff --git a/build/geo-three.module.js b/build/geo-three.module.js index 71816f6..5348160 100644 --- a/build/geo-three.module.js +++ b/build/geo-three.module.js @@ -176,7 +176,7 @@ class MapNodeGeometry extends BufferGeometry { class CanvasUtils { static createOffscreenCanvas(width, height) { - if (OffscreenCanvas) { + if (typeof OffscreenCanvas !== 'undefined') { return new OffscreenCanvas(width, height); } else { @@ -316,7 +316,7 @@ class UnitsUtils { return { latitude: latitude, longitude: longitude }; } } -UnitsUtils.EARTH_RADIUS = 6378137; +UnitsUtils.EARTH_RADIUS = 6371008; UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS; UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0; @@ -1394,12 +1394,7 @@ class XHRUtils { if (onProgress !== undefined) { xhr.onprogress = onProgress; } - if (body !== undefined) { - xhr.send(body); - } - else { - xhr.send(null); - } + xhr.send(body !== undefined ? body : null); return xhr; } } @@ -1416,7 +1411,7 @@ class BingMapsProvider extends MapProvider { this.maxZoom = 19; } getMetaData() { - const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; + const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey; XHRUtils.get(address, function (data) { JSON.parse(data); }); @@ -1450,6 +1445,7 @@ class BingMapsProvider extends MapProvider { }); } } +BingMapsProvider.ADDRESS = "https://dev.virtualearth.net"; BingMapsProvider.AERIAL = 'a'; BingMapsProvider.ROAD = 'r'; BingMapsProvider.AERIAL_LABELS = 'h'; diff --git a/build/providers/BingMapsProvider.d.ts b/build/providers/BingMapsProvider.d.ts index 5077c32..4f6db34 100644 --- a/build/providers/BingMapsProvider.d.ts +++ b/build/providers/BingMapsProvider.d.ts @@ -1,5 +1,6 @@ import { MapProvider } from './MapProvider'; export declare class BingMapsProvider extends MapProvider { + static ADDRESS: string; maxZoom: number; apiKey: string; type: string; diff --git a/package.json b/package.json index f865934..6b2054b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "geo-three", - "version": "0.1.1", + "version": "0.1.2", "type": "module", "description": "geo-three is library for tile based geographic map layers in with three.js supporting selective loading/unloading of real-time generated 3D tiles", "main": "build/Main.d.ts",