Creating a globe map with visibility features in TypeScript and working with 3D maps globes
Olatunji Ayodele Abidemi
Posted on April 10, 2024
import { Globe } from '@openglobus/og/Globe';
import { XYZ } from '@openglobus/og/layer/XYZ';
// Create a new globe instance
const globe = new Globe({
'target': 'globeDiv', // The ID of the div element where the globe will be rendered
'name': 'Earth',
'layers': [
new XYZ({
'isBaseLayer': true,
'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
'attribution': 'Data @ OpenStreetMap contributors, ODbL'
})
]
});
// Set the initial view for the globe
globe.setView({
'lat': 0,
'lon': 0,
'alt': 10000000, // Altitude in meters
'duration': 1000 // Duration of the initial animation in milliseconds
});
Posted on April 10, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
April 10, 2024
February 9, 2022