Skip to content

openmrs-webgl-Globe is a platform for visualizing latitude longitude based information using WebGL and data from OpenMRS Atlas

License

Notifications You must be signed in to change notification settings

KMITFOSS/openmrs-webgl-globe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

The OpenMRS WebGL Globe is a fork from chromeexperiments to visualize openrms implementers data provided at openmrs atlas.

Check out the examples at http://www.chromeexperiments.com/globe, and if you create a globe, please share it with us. We post our favorite globes publicly.


The WebGL Globe supports data in JSON format, a sample of which you can find here. webgl-globe makes heavy use of the Three.js library.

Data Format

The following illustrates the JSON data format that the globe expects:

var data = [
    [
    'seriesA', [ latitude, longitude, magnitude, latitude, longitude, magnitude, ... ]
    ],
    [
    'seriesB', [ latitude, longitude, magnitude, latitude, longitude, magnitude, ... ]
    ]
];

Basic Usage

The following code polls a JSON file (formatted like the one above) for geo-data and adds it to an animated, interactive WebGL globe.

// Where to put the globe?
var container = document.getElementById( 'container' );

// Make the globe
var globe = new DAT.Globe( container );

// We're going to ask a file for the JSON data.
var xhr = new XMLHttpRequest();

// Where do we get the data?
xhr.open( 'GET', 'myjson.json', true );

// What do we do when we have it?
xhr.onreadystatechange = function() {

    // If we've received the data
    if ( xhr.readyState === 4 && xhr.status === 200 ) {

        // Parse the JSON
        var data = JSON.parse( xhr.responseText );

        // Tell the globe about your JSON data
        for ( var i = 0; i < data.length; i ++ ) {
            globe.addData( data[i][1], {format: 'magnitude', name: data[i][0]} );
        }

        // Create the geometry
        globe.createPoints();

        // Begin animation
        globe.animate();

    }

};

// Begin request
xhr.send( null );

Starting a local development server

npm install
npm start

Navigate to http://localhost:3000 to see the demo.

Tested with Node 5.7 and npm 3.6.

Deploy to Heroku

  1. Create a Procfile
touch procfile
nano procfile
  1. Add this line to the procfile-
web: node index.js
  1. Follow the steps on the website to download heroku-cli https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up after that
heroku login
  1. In the terminal go to your repo or clone it & cd into it
git clone https://github.com/Foo/Bar.git
cd Bar
  1. Create a heroku app, a random name gets generated & its git remote is added
heroku create

git push heroku master
  1. To view your app
heroku open

Wanna know some more regarding openmrs?

OpenMRS

  • OpenMRS is a collaborative open source project to develop software to support the delivery of health care in developing countries
  • OpenMRS

OpenMRS Atlas

  • The OpenMRS Atlas is a website on which members of the OpenMRS Community can register their site(s). The Atlas serves not only to let the world know about your site, but also help sites to discover other implementations in their region.
  • OpenMRS Atlas

About

openmrs-webgl-Globe is a platform for visualizing latitude longitude based information using WebGL and data from OpenMRS Atlas

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published