Skip to content

Commit 9ad8dbc

Browse files
committed
Update build
1 parent ce1f368 commit 9ad8dbc

File tree

5 files changed

+17
-28
lines changed

5 files changed

+17
-28
lines changed

build/geo-three.cjs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class MapNodeGeometry extends three.BufferGeometry {
180180

181181
class CanvasUtils {
182182
static createOffscreenCanvas(width, height) {
183-
if (OffscreenCanvas) {
183+
if (typeof OffscreenCanvas !== 'undefined') {
184184
return new OffscreenCanvas(width, height);
185185
}
186186
else {
@@ -320,7 +320,7 @@ class UnitsUtils {
320320
return { latitude: latitude, longitude: longitude };
321321
}
322322
}
323-
UnitsUtils.EARTH_RADIUS = 6378137;
323+
UnitsUtils.EARTH_RADIUS = 6371008;
324324
UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS;
325325
UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0;
326326

@@ -1398,12 +1398,7 @@ class XHRUtils {
13981398
if (onProgress !== undefined) {
13991399
xhr.onprogress = onProgress;
14001400
}
1401-
if (body !== undefined) {
1402-
xhr.send(body);
1403-
}
1404-
else {
1405-
xhr.send(null);
1406-
}
1401+
xhr.send(body !== undefined ? body : null);
14071402
return xhr;
14081403
}
14091404
}
@@ -1420,7 +1415,7 @@ class BingMapsProvider extends MapProvider {
14201415
this.maxZoom = 19;
14211416
}
14221417
getMetaData() {
1423-
const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1418+
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
14241419
XHRUtils.get(address, function (data) {
14251420
JSON.parse(data);
14261421
});
@@ -1454,6 +1449,7 @@ class BingMapsProvider extends MapProvider {
14541449
});
14551450
}
14561451
}
1452+
BingMapsProvider.ADDRESS = "https://dev.virtualearth.net";
14571453
BingMapsProvider.AERIAL = 'a';
14581454
BingMapsProvider.ROAD = 'r';
14591455
BingMapsProvider.AERIAL_LABELS = 'h';

build/geo-three.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180

181181
class CanvasUtils {
182182
static createOffscreenCanvas(width, height) {
183-
if (OffscreenCanvas) {
183+
if (typeof OffscreenCanvas !== 'undefined') {
184184
return new OffscreenCanvas(width, height);
185185
}
186186
else {
@@ -320,7 +320,7 @@
320320
return { latitude: latitude, longitude: longitude };
321321
}
322322
}
323-
UnitsUtils.EARTH_RADIUS = 6378137;
323+
UnitsUtils.EARTH_RADIUS = 6371008;
324324
UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS;
325325
UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0;
326326

@@ -1398,12 +1398,7 @@
13981398
if (onProgress !== undefined) {
13991399
xhr.onprogress = onProgress;
14001400
}
1401-
if (body !== undefined) {
1402-
xhr.send(body);
1403-
}
1404-
else {
1405-
xhr.send(null);
1406-
}
1401+
xhr.send(body !== undefined ? body : null);
14071402
return xhr;
14081403
}
14091404
}
@@ -1420,7 +1415,7 @@
14201415
this.maxZoom = 19;
14211416
}
14221417
getMetaData() {
1423-
const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1418+
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
14241419
XHRUtils.get(address, function (data) {
14251420
JSON.parse(data);
14261421
});
@@ -1454,6 +1449,7 @@
14541449
});
14551450
}
14561451
}
1452+
BingMapsProvider.ADDRESS = "https://dev.virtualearth.net";
14571453
BingMapsProvider.AERIAL = 'a';
14581454
BingMapsProvider.ROAD = 'r';
14591455
BingMapsProvider.AERIAL_LABELS = 'h';

build/geo-three.module.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class MapNodeGeometry extends BufferGeometry {
176176

177177
class CanvasUtils {
178178
static createOffscreenCanvas(width, height) {
179-
if (OffscreenCanvas) {
179+
if (typeof OffscreenCanvas !== 'undefined') {
180180
return new OffscreenCanvas(width, height);
181181
}
182182
else {
@@ -316,7 +316,7 @@ class UnitsUtils {
316316
return { latitude: latitude, longitude: longitude };
317317
}
318318
}
319-
UnitsUtils.EARTH_RADIUS = 6378137;
319+
UnitsUtils.EARTH_RADIUS = 6371008;
320320
UnitsUtils.EARTH_PERIMETER = 2 * Math.PI * UnitsUtils.EARTH_RADIUS;
321321
UnitsUtils.EARTH_ORIGIN = UnitsUtils.EARTH_PERIMETER / 2.0;
322322

@@ -1394,12 +1394,7 @@ class XHRUtils {
13941394
if (onProgress !== undefined) {
13951395
xhr.onprogress = onProgress;
13961396
}
1397-
if (body !== undefined) {
1398-
xhr.send(body);
1399-
}
1400-
else {
1401-
xhr.send(null);
1402-
}
1397+
xhr.send(body !== undefined ? body : null);
14031398
return xhr;
14041399
}
14051400
}
@@ -1416,7 +1411,7 @@ class BingMapsProvider extends MapProvider {
14161411
this.maxZoom = 19;
14171412
}
14181413
getMetaData() {
1419-
const address = 'http://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
1414+
const address = BingMapsProvider.ADDRESS + '/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&include=ImageryProviders&key=' + this.apiKey;
14201415
XHRUtils.get(address, function (data) {
14211416
JSON.parse(data);
14221417
});
@@ -1450,6 +1445,7 @@ class BingMapsProvider extends MapProvider {
14501445
});
14511446
}
14521447
}
1448+
BingMapsProvider.ADDRESS = "https://dev.virtualearth.net";
14531449
BingMapsProvider.AERIAL = 'a';
14541450
BingMapsProvider.ROAD = 'r';
14551451
BingMapsProvider.AERIAL_LABELS = 'h';

build/providers/BingMapsProvider.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { MapProvider } from './MapProvider';
22
export declare class BingMapsProvider extends MapProvider {
3+
static ADDRESS: string;
34
maxZoom: number;
45
apiKey: string;
56
type: string;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geo-three",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"type": "module",
55
"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",
66
"main": "build/Main.d.ts",

0 commit comments

Comments
 (0)