diff --git a/assets/data/connections.js b/assets/data/connections.js index ca315f0..7bc0f6c 100644 --- a/assets/data/connections.js +++ b/assets/data/connections.js @@ -1,12 +1,14 @@ data.connections = { Colombia: [ + "New York", + "Ashbern", "Ecuador", "Cuba", // "Mexico", "Peru", "Venezuela, RB", "Guyana", - "United States", + // "United States", ], "South Sudan": [ "Nigeria", @@ -44,7 +46,7 @@ data.connections = { "Colombia", "Peru", "Venezuela, RB", - "United States", + // "United States", ], Fiji: [ "Tuvalu", diff --git a/assets/data/countries.all.json b/assets/data/countries.all.json index 8ad1848..147c317 100644 --- a/assets/data/countries.all.json +++ b/assets/data/countries.all.json @@ -3951,18 +3951,18 @@ "longitude": "-56.0675", "latitude": "-34.8941" }, - { - "id": "USA", - "iso2Code": "US", - "name": "United States", - "region": { "id": "NAC", "iso2code": "XU", "value": "North America" }, - "adminregion": { "id": "", "iso2code": "", "value": "" }, - "incomeLevel": { "id": "HIC", "iso2code": "XD", "value": "High income" }, - "lendingType": { "id": "LNX", "iso2code": "XX", "value": "Not classified" }, - "capitalCity": "Washington D.C.", - "longitude": "-77.032", - "latitude": "38.8895" - }, + // { + // "id": "USA", + // "iso2Code": "US", + // "name": "United States", + // "region": { "id": "NAC", "iso2code": "XU", "value": "North America" }, + // "adminregion": { "id": "", "iso2code": "", "value": "" }, + // "incomeLevel": { "id": "HIC", "iso2code": "XD", "value": "High income" }, + // "lendingType": { "id": "LNX", "iso2code": "XX", "value": "Not classified" }, + // "capitalCity": "Washington D.C.", + // "longitude": "-77.032", + // "latitude": "38.8895" + // }, { "id": "UZB", "iso2Code": "UZ", diff --git a/assets/data/countries.js b/assets/data/countries.js index a35dbfd..101b9e4 100644 --- a/assets/data/countries.js +++ b/assets/data/countries.js @@ -43,7 +43,7 @@ data.countries = [ { name: "Denmark", latitude: "55.6763", longitude: "12.5681" }, { name: "Romania", latitude: "44.4479", longitude: "26.0979" }, // { name: "Mexico", latitude: "19.427", longitude: "-99.1276" }, - { name: "United States", latitude: "38.8895", longitude: "-77.032" }, + // { name: "United States", latitude: "38.8895", longitude: "-77.032" }, { name: "Greenland", latitude: "64.1836", longitude: "-51.7214" }, { name: "Iceland", latitude: "64.1353", longitude: "-21.8952" }, { name: "Ecuador", latitude: "-0.229498", longitude: "-78.5243" }, diff --git a/assets/data/processing.js b/assets/data/processing.js index a433deb..0d68fa5 100644 --- a/assets/data/processing.js +++ b/assets/data/processing.js @@ -12,7 +12,7 @@ const SouthAmerica = [ "Cuba", ]; -const NorthAmerica = ["Mexico", "United States", "Greenland", "Iceland"]; +// const NorthAmerica = ["Mexico", "United States", "Greenland", "Iceland"]; const Europe = [ "Norway", @@ -99,7 +99,7 @@ const connections = { "Peru", "Venezuela, RB", "Guyana", - "United States", + // "United States", ], "South Sudan": [ "Nigeria", diff --git a/scripts/marker.js b/scripts/marker.js index d8adb0a..23b9dc6 100644 --- a/scripts/marker.js +++ b/scripts/marker.js @@ -1,9 +1,15 @@ class Marker { - constructor(material, geometry, label, cords, { - textColor = 'white', - pointColor = config.colors.globeMarkerColor, - glowColor = config.colors.globeMarkerGlow - } = {}) { + constructor( + material, + geometry, + label, + cords, + { + textColor = "white", + pointColor = config.colors.globeMarkerColor, + glowColor = config.colors.globeMarkerGlow, + } = {} + ) { this.material = material; this.geometry = geometry; this.labelText = label; @@ -16,7 +22,7 @@ class Marker { this.glowColor = new THREE.Color(glowColor); this.group = new THREE.Group(); - this.group.name = 'Marker'; + this.group.name = "Marker"; this.createLabel(); this.createPoint(); @@ -32,13 +38,13 @@ class Marker { texture.minFilter = THREE.LinearFilter; textures.markerLabels.push(texture); - const material = new THREE.SpriteMaterial() + const material = new THREE.SpriteMaterial(); material.map = texture; - material.depthTest = false; + material.depthTest = true; material.useScreenCoordinates = false; this.label = new THREE.Sprite(material); - this.label.scale.set( 40, 20, 1 ); + this.label.scale.set(40, 20, 1); this.label.center.x = 0.25; this.label.translateY(2); @@ -47,14 +53,14 @@ class Marker { } createPoint() { - this.point = new THREE.Mesh( this.geometry, this.material ); + this.point = new THREE.Mesh(this.geometry, this.material); this.point.material.color.set(this.pointColor); this.group.add(this.point); elements.markerPoint.push(this.point); } createGlow() { - this.glow = new THREE.Mesh( this.geometry, this.material.clone() ); + this.glow = new THREE.Mesh(this.geometry, this.material.clone()); this.glow.material.color.set(this.glowColor); this.glow.material.opacity = 0.6; this.group.add(this.glow); @@ -62,17 +68,17 @@ class Marker { } animateGlow() { - if(!this.isAnimating) { - if(Math.random() > 0.99) { + if (!this.isAnimating) { + if (Math.random() > 0.99) { this.isAnimating = true; } - } else if(this.isAnimating) { + } else if (this.isAnimating) { this.glow.scale.x += 0.025; this.glow.scale.y += 0.025; this.glow.scale.z += 0.025; this.glow.material.opacity -= 0.005; - if(this.glow.scale.x >= 4) { + if (this.glow.scale.x >= 4) { this.glow.scale.x = 1; this.glow.scale.y = 1; this.glow.scale.z = 1; @@ -83,17 +89,19 @@ class Marker { } setPosition() { - const {x, y, z} = this.cords - this.group.position.set(-x, y, -z) + const { x, y, z } = this.cords; + this.group.position.set(-x, y, -z); } createText() { - const element = document.createElement('canvas'); + const element = document.createElement("canvas"); const canvas = new fabric.Canvas(element); const text = new fabric.Text(this.labelText, { - left: 0, top: 0, fill: this.textColor, - fontFamily: 'Open Sans', + left: 0, + top: 0, + fill: this.textColor, + fontFamily: "Open Sans", }); canvas.add(text); diff --git a/scripts/markers.js b/scripts/markers.js index e7bf631..6ae5fb6 100644 --- a/scripts/markers.js +++ b/scripts/markers.js @@ -1,12 +1,11 @@ class Markers { - constructor(countries, { - markerRadius = 2 - } = {}) { + constructor(countries, { markerRadius = 2 } = {}) { this.countries = countries; - this.radius = config.sizes.globe + config.sizes.globe * config.scale.markers; + this.radius = + config.sizes.globe + config.sizes.globe * config.scale.markers; groups.markers = new THREE.Group(); - groups.markers.name = 'GlobeMarkers'; + groups.markers.name = "GlobeMarkers"; this.markerGeometry = new THREE.SphereGeometry(markerRadius, 15, 15); this.markerMaterial = new THREE.MeshBasicMaterial(); @@ -17,16 +16,21 @@ class Markers { } create() { - for(let i = 0; i < this.countries.length; i++) { + for (let i = 0; i < this.countries.length; i++) { const country = this.countries[i]; - if(country.latitude && country.longitude) { + if (country.latitude && country.longitude) { const lat = +country.latitude; const lng = +country.longitude; const cords = toSphereCoordinates(lat, lng, this.radius); - const marker = new Marker(this.markerMaterial, this.markerGeometry, country.name, cords); + const marker = new Marker( + this.markerMaterial, + this.markerGeometry, + country.name, + cords + ); elements.markers.push(marker); } } } -} \ No newline at end of file +}