Giter Club home page Giter Club logo

a-frame-component-three-geo-updated's Introduction

A-Frame Component: Three-Geo (Updated Version)

Video screen capture

Description / Rationale

This is an updated version of A-Frame component for "Three-geo", the library for 3D geographic visualization. The original version of the component was developed by KJStrand. The updated version is compatible with latest version of A-frame and has the following new features:

  • The component and three-geo files were combined into single file;
  • Flat map style was added;
  • Possibility of selecting the style of the map: elevated, wireframe and contour
  • Possibility of assigning color to wireframe styled map.

Instructions

In order to use the component attach "three-geo" to any entity. The component has the following attributes:

  • token: { type: 'string', default: '*******' } - Token generated by Mapbox.
  • lat: { type: 'number', default: 35.3778 } - latitude of the location on Mapbox.
  • lng: { type: 'number', default: 138.7472 } - longitude of the location on Mapbox.
  • radius: { type: 'number', default: 5.0 } - radius of bounding circle (km).
  • zoom: { type: 'number', default: 10 } - zoom level.
  • axesHelper: { type: 'boolean', default: false } - Axes helper to learn about orientation in 3d space.
  • flatMap: { type: 'boolean', default: false } - Flat map style without any elevations.
  • mapStyle: { type: 'string', default: "elevated" } - The following map styles are present: elevated, wireframe and contour. Will show if flatMap is false.
  • wireframeColor: { type: 'color', default: "#ffffff" } - if wireframe map style is selected, allows to change the color of the wireframe.

The code below shows the sample implementation of the component:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>A-Frame Component: Three-geo (Updated)</title>
    <script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
    <script src="js/three-geo-component.js">
    </script>
</head>
<body>
    <a-scene>
        <a-entity id="first" three-geo="token: your-mapbox-token-here;
                   lat: 36.2058;
                   lng:  -112.4413;
                   radius: 5;
                   zoom: 13;
                   axesHelper: false;
                   flatMap: false;
                   mapStyle: elevated;
                   wireframeColor: #ffffff;
                   " rotation="-90 180 0" position="0 0.7 -1.5" scale="2 2 2"></a-entity>
                   <a-sky color="#000000"></a-sky>
    </a-scene>
</body>
</html>

To learn more about "Three-geo" library, check the repository page of it.

Tech Stack

The project is powered by AFrame and Three.js.

Demo

See demo of the component here: Demo

a-frame-component-three-geo-updated's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.