• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
samjb123

samjb123

globe

Public
Like
globe
Home
Code
5
README.md
globe.js
index.html
H
server.ts
styles.css
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
server.ts
https://samjb123--dade376c36de11f0a8d79e149126039e.web.val.run
README.md

Interactive 3D Globe Component

This is a customizable 3D globe component that allows you to display geographic locations with interactive markers and information tooltips.

Features

  • Interactive 3D globe with smooth rotation and zoom
  • Clickable markers for different regions/locations
  • Information tooltips that appear when a region is selected
  • Responsive design that adapts to different screen sizes
  • Customizable colors, sizes, and regions

Usage

Basic Setup

  1. Include the required files in your HTML:
<link rel="stylesheet" href="styles.css"> <script src="https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/three@0.160.0/examples/js/controls/OrbitControls.js"></script> <script src="globe.js"></script>
  1. Add a container element where you want the globe to appear:
<div id="globe-container"></div>
  1. Initialize the globe component:
document.addEventListener('DOMContentLoaded', () => { const globe = new GlobeComponent('globe-container'); });

Customization

You can customize the globe by passing options to the constructor:

const globe = new GlobeComponent('globe-container', { globeSize: 500, maxGlobeSize: 800, globeColor: 0x1a73e8, highlightColor: 0x00a8ff, markerColor: 0xffffff, regions: [ { name: "New York", lat: 40.7128, lng: -74.0060, id: "nyc" }, { name: "London", lat: 51.5074, lng: -0.1278, id: "london" }, { name: "Tokyo", lat: 35.6762, lng: 139.6503, id: "tokyo" } ] });

Available Options

OptionTypeDefaultDescription
globeSizeNumber486Initial size of the globe in pixels
maxGlobeSizeNumber700Maximum size of the globe in pixels
globeColorNumber (hex)0x3a7bd5Color of the globe
highlightColorNumber (hex)0x00a8ffColor of highlighted markers
markerColorNumber (hex)0xffffffDefault color of markers
regionsArray[...]Array of region objects with name, lat, lng, and id

Customizing Regions

Each region object should have the following properties:

{ name: "Region Name", // Display name lat: 40.7128, // Latitude lng: -74.0060, // Longitude id: "unique-id" // Unique identifier }

Advanced Customization

You can modify the globe.js file to customize the appearance and behavior of the globe component. The main class GlobeComponent contains methods for creating and manipulating the 3D scene.

Browser Compatibility

This component uses Three.js and modern JavaScript features. It should work in all modern browsers (Chrome, Firefox, Safari, Edge).

License

MIT

HTTP
  • server.ts
    samjb123--da…9e.web.val.run
Code
README.mdglobe.jsindex.html
H
server.ts
styles.css
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.