npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rwt-orthographic-earth

v1.0.38

Published

An orthographic projection of Earth, a standards-based DOM Component

Downloads

4

Readme

Premium DOM Component

Orthographic Earth

A world of possibilities

Background

All global maps suffer from distortion. This is because maps are a 2-dimensional projection of a 3-dimensional Earth. Attempts to display the entire world on a single rectangular canvas suffer more acutely than maps that are limited to just a portion of Earth at a time.

As an example, the Mercator projection exaggerates the size of the polar regions. This makes Canada, Greenland, and Russia appear much large than Africa, and turns Antarctica into an unrecognizable shape.

Another alternative — commonly used in thematic maps — is the equi-rectangular projection. It has less exaggerated areas than the Mercator projection, but still suffers because it plots each latitude without regard for the shorter longitudinal distances of the polar regions.

In contrast, the orthographic projection has faithful areas and angles near the point of perspective, with distortion occuring gradually, and only being noticable near the horizons. The primary drawback with orthographic projections in the past has been the fact that they only represent one-half of the world.

The Orthographic Earth DOM component provides an excellent alternative for cartographers who want to tell thematic stories on a global scale.

The Orthographic Earth component has these features:

  • The component can be used within any HTML document.
  • The drawing can be resized to fit the device's screen size, allowing it to be used on both small cell phones and large mega-pixel monitors.
  • The component is self-contained, which allows for the possibility of having two or more Earth drawings appear side-by-side on the same page.
  • The user interface supports both touchscreen and mouse gestures for scaling, translation, rotation and tilt.
  • Users can locate and identify features by pointing to them.
  • Webmasters can use the component's event-based interface to monitor user interactions, allowing synchronization with other parts of the HTML page.
  • Features can be styled using a declarative visual stylesheet language.

Data layers can use sources with any of these supported formats. See GCS I/O for more about these formats. See Better Compression of GIS Features for optimization techniques.

  • gfe - Geographic Feature Encoding
  • ice - Indexed Coordinate Encoding
  • tae - Topological Arc Encoding
  • gfebin - Geographic Feature Encoding binary
  • icebin - Indexed Coordinate Encoding binary
  • taebin - Topological Arc Encoding binary
  • geojson - RFC 7946
  • topojson - (Specification )

In the wild

To see examples of this component in use, visit any of these:

Installation

Using the component

After installation, you need to add three things to your HTML page to make use of it:

  1. Add an importmap and a script tag to load the component and its dependencies:
<script src='/node_modules/es-module-shims/dist/es-module-shims.js' async></script>
<script type=importmap-shim>
{
    "imports": {
        "gcsio/": "/node_modules/gcsio/",
        "softlib/": "/node_modules/softlib/",
        "rwt-dockable-panels/": "/node_modules/rwt-dockable-panels/"
    }
}            
</script>
<script src='/node_modules/rwt-orthographic-earth/rwt-orthographic-earth.js' type=module-shim></script>             
  1. Add the component tag somewhere on the page.

    • For scripting purposes, apply an id attribute.
    • For WAI-ARIA accessibility apply a role=contentinfo attribute.
<rwt-orthographic-earth id=earth1 role=contentinfo></rwt-orthographic-earth>
  1. Listen for the component to be fully loaded before programmatically configuring its layers, stylesheets, and initial settings. Here's an example:
<script type=module-shim>
     var earth1 = document.getElementById('earth1');
     var promise = earth1.waitOnLoading();
     promise.then(() => {
         addLayers(earth1);
         configure(earth1);
     });
     
     function addLayers(earth1) {
        earth1.addVisualizationStyleSheet('/vss/earth1-styles.vss');
        earth1.addMapItem({ layerType:'space', vssIdentifier: 'space', layerName: 'Space' });
        earth1.addMapItem({ layerType:'sphere', vssIdentifier: 'sphere', layerName: 'Oceans' });
        earth1.addMapItem({ layerType:'graticule', vssIdentifier: 'graticule-3-by-3',layerName: 'Graticule',  meridianFrequency:3, parallelFrequency:3, drawToPoles:false });
        earth1.addMapItem({ layerType:'gcs-package', vssIdentifier: 'land-110m', layerName: 'Land', url:'/natural-earth/land-110m.geojson', featureKey:'name' });
     }
     
     function configure(earth1) {
        earth1.setLatitude(12.98);
        earth1.setLongitude(77.58);
        earth1.setRotationSpeed(-1);
    }
</script>        

Configure the Component

The component can be configured by adding any of these optional attributes to the <rwt-orthographic-earth> element tag.

Life-cycle events

The component issues life-cycle events.

Metadata

Module exports

Suitability

Availability

License

The rwt-orthographic-earth DOM component is not freeware. After evaluating it and before using it in a public-facing website, eBook, mobile app, or desktop application, you must obtain a license from Read Write Tools .

Activation

To activate your license, copy the rwt-registration-keys.js file to the root directory of your website, providing the customer-number and access-key sent to your email address, and replacing example.com with your website's hostname. Follow this example: