Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrate Extent to typescript #2444

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion examples/jsm/OGC3DTilesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function zoomToSphere(view, tile, sphere) {
const distance = radius * Math.tan(fov * 2);

return {
coord: new Coordinates('EPSG:4978', center),
coord: new Coordinates('EPSG:4978').setFromVector3(center),
range: distance + radius,
};
}
Expand Down
10 changes: 7 additions & 3 deletions src/Controls/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ class GlobeControls extends THREE.EventDispatcher {
const range = this.getRange(point);
if (point && range > this.minDistance) {
return this.lookAtCoordinate({
coord: new Coordinates('EPSG:4978', point),
coord: new Coordinates('EPSG:4978').setFromVector3(point),
range: range * (event.direction === 'out' ? 1 / 0.6 : 0.6),
time: 1500,
});
Expand Down Expand Up @@ -1028,7 +1028,9 @@ class GlobeControls extends THREE.EventDispatcher {
*/

getCameraCoordinate() {
return new Coordinates('EPSG:4978', this.camera.position).as('EPSG:4326');
return new Coordinates('EPSG:4978')
.setFromVector3(this.camera.position)
.as('EPSG:4326');
}

/**
Expand Down Expand Up @@ -1216,7 +1218,9 @@ class GlobeControls extends THREE.EventDispatcher {
return;
}

return new Coordinates('EPSG:4978', pickedPosition).as('EPSG:4326');
return new Coordinates('EPSG:4978')
.setFromVector3(pickedPosition)
.as('EPSG:4326');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Converter/textureConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as THREE from 'three';
import Feature2Texture from 'Converter/Feature2Texture';
import Extent from 'Core/Geographic/Extent';

const extentTexture = new Extent('EPSG:4326', [0, 0, 0, 0]);
const extentTexture = new Extent('EPSG:4326');

const textureLayer = (texture, layer) => {
texture.generateMipmaps = false;
Expand Down
332 changes: 0 additions & 332 deletions src/Core/Geographic/Coordinates.js

This file was deleted.

Loading
Loading