Comments (1)
Found one the solution, Any other suggested solution,
<script lang="ts">
import { onMount } from "svelte";
import * as THREE from "three";
import ThreeGlobe from "globe.gl";
import countries from "../../assets/custom.geo.json";
let globeElem: HTMLElement;
let map = {
coordinates: [
{
text: "IND",
size: 1.0,
country: "India",
city: "Chennai",
lat: "13.089869",
lng: "80.245901",
},
],
};
let Globe: any;
onMount(() => {
function init() {
Globe = ThreeGlobe({
waitForGlobeReady: true,
animateIn: true,
})
.backgroundColor("#fff")
.hexPolygonsData(countries.features)
.hexPolygonResolution(3)
.hexPolygonColor(() => "#c600e5")
.hexPolygonMargin(0.7)
.showAtmosphere(true)
.atmosphereColor("#fff")
.showAtmosphere(false)
.atmosphereAltitude(0.25)
.labelsData(map.coordinates)
.labelColor(() => "#ffcb23")
.labelDotRadius(0.3)
.labelSize((e: any) => e.size)
.labelText("city")
.labelResolution(6)
.labelAltitude(0.01)
.pointsData(map.coordinates)
.pointColor(() => "#c600e5")
.pointAltitude(0.07)
.pointLabel(
() => `<div style="width:200px; height:100px; background:white;cursor:pointer;">
<p>hello world</p>
</div>`
)(globeElem);
const globeMaterial = Globe.globeMaterial();
globeMaterial.color = new THREE.Color(0xffffff);
}
init();
});
const onLoadCoord = () => {
const coordinatesCopy = [...map.coordinates];
// update the Globe with existing points
Globe.pointsData([
coordinatesCopy,
{
text: "UAE",
size: 1.0,
country: "United Arab Emirates",
city: "Dubai",
lat: "23.214066",
lng: "53.195262",
},
]);
};
</script>
<div class="globe" bind:this={globeElem} />
<div class="absolute top-0 left-5">
<button class="p-5 bg-red-400" on:click={onLoadCoord}>
Change Coordinates
</button>
</div>
from globe.gl.
Related Issues (20)
- Loading Errors in Nuxt HOT 2
- Blue Artifact Appears Inside Globe When Rotating with .showAtmosphere Enabled HOT 2
- Cumulative delay in Rings/Arcs animations start
- Is it possible to define different height for each tile? HOT 1
- Double Click Event Not Working on Globe HOT 1
- Positioning globe in canvas HOT 2
- Clouds layer makes globe itself disappear when spinning it HOT 1
- Starts a FrameTicker when imported HOT 2
- Drag event HOT 1
- Transparent globe with PNG texture HOT 2
- Is it possible to update the texture of a map on zoom? HOT 2
- is there anyway to disable mouse scroll zooming globe? HOT 1
- ForwardRef in dynamic import HOT 2
- Tr
- Ok
- import dynamically HOT 13
- Globe autorotates very quickly if the page is in background for a while HOT 3
- For tilelayer, can it achieve something like googlemap?
- Arc dash animation stops when labels are implemented HOT 5
- Why does it take so long to set the heatmapsData? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from globe.gl.