Edit Globe settings

This commit is contained in:
2022-09-26 13:10:30 +02:00
parent 193f6dc2ee
commit 0cc996e117
2 changed files with 4 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
const isDev = import.meta.env.DEV
export let type: string = undefined
export let autoRotate: boolean = true
export let enableMarkers: boolean = true
export let enableMarkersLinks: boolean = true
export let speed: number = 0.1
@@ -48,7 +49,7 @@
mapFile: `/images/globe-map-${globeResolution}k.png`,
mapFileDark: `/images/globe-map-dark-${globeResolution}k.png`,
dpr: Math.min(Math.round(window.devicePixelRatio), 2),
autoRotate: true,
autoRotate,
speed,
sunAngle: 2,
rotationStart: randomContinent.rotation,

View File

@@ -16,6 +16,7 @@ export class Globe {
this.width = this.el.offsetWidth
this.height = this.el.offsetHeight
this.markers = options.markers || []
this.globeZoom = 1.3075
this.globeRotation = {
lat: degToRad(-this.options.rotationStart) || 0,
// lng: degToRad(-this.options.rotationStart.lng) || 0,
@@ -49,7 +50,6 @@ export class Globe {
speed: options.speed,
enableMarkers: options.enableMarkers,
enableMarkersLinks: options.enableMarkersLinks,
zoom: 1.3075,
sunAngle: options.sunAngle || 0,
sunAngleDelta: 1.8,
}
@@ -93,7 +93,7 @@ export class Globe {
// Create camera
this.camera = new Camera(this.gl)
this.camera.position.set(0, 0, this.params.zoom)
this.camera.position.set(0, 0, this.globeZoom)
// Create controls
this.controls = new Orbit(this.camera, {