thematic-earth
Version:
HTML-based, whole-Earth thematic maps using locally hosted data layers
2 lines • 627 B
JavaScript
/* Copyright (c) 2023 Read Write Tools. Legal use subject to the Thematic Earth Software License Agreement. */
import PolygonFeature from'./polygon-feature.class.js';import ProjectedPoint from'../projection/projected-point.class.js';import*as ECEF from'../spherical-earth/coordinate-translations.js';export default class HemisphereFeature extends PolygonFeature{constructor(t){super();for(let i=0;i<t+1;i++){var e=i*(2*Math.PI/t)+Math.PI/2,o=Math.cos(e),a=Math.sin(e),{latitude:r,longitude:s}=ECEF.xyz2ll(o,0,a);Math.abs(r)<.1?s-=.1:s-=.1*Math.abs(1/r),r>89.9?r=89.9:r<-89.9&&(r=-89.9),this.addPoint(new ProjectedPoint(r,s))}}}