Contents
VR Map: WebXR with OpenStreetMap Data
The following slides are available in this presentation:
VR Map: WebXR with OpenStreetMap Data
Simple GeoData Visualization with A-Frame
Slides: https://slides.kairo.at/fossxr2019/
- Created for a presentation at FOSS XR Conference 2019 in Amsterdam, Netherlands.
- Written in HTML 5 with CSS 3 and JavaScript.
- Navigation via links on all slides, via access keys (e.g. "n"/Alt+Shift+N for "next") or back/forward arrow keys
- Contents
04/2018-10/2019 Robert Kaiser - "Mozilla", "Firefox" and their logos are trademarks of Mozilla Foundation.
Robert Kaiser - KaiRo

- kairo@kairo.at / home.kairo.at
- Mozilla Tech Speaker
- FLOSS supporter for 20+ years
- Based in Vienna, Austria
- Not on most major social networks
- But on Diaspora*, Mozillians, Telegram, LinkedIn, KaiRo-at at GitHub
Objectives

- Cross-Device nature of WebVR/WebXR
- Ease of use of A-Frame
- Ability to use OpenStreetMap data
WebVR & WebXR

- WebVR: Virtual Reality powered by Web technologies
- Evolving into WebXR Device API - Mixed Reality (Virtual + Augmented Reality)
- Open Standard (proposal, W3C), in concert with WebGL, WebAudio and Gamepad APIs
Browser Support

- Firefox: WebVR in Windows (55+) & MacOS X (64+) release, Linux in development
- Chrome: experimental WebVR support (behind flags in dev builds)
- Stand-alone headsets: WebVR in Firefox Reality, Oculus Browser, Samsung Internet, Edge on HoloLens
- Firefox Reality and Chrome will ship WebXR (for VR) in December, Firefox desktop coming soon
VR Map

- Demo for WebVR with live OpenStreetMap data
- Usable in 2D mode on any modern browser
- Supports headset + controller where WebVR is supported
- Using A-Frame (see later)
- Simple: Currently ~80 lines HTML, ~600 lines JS
vrmap.kairo.at
Code Basics

- The world is flat (in two ways)!
- Ground tiles using Mercator projection, "Mapnik" rendering from OSM via KaiRo's tile caching server
- Trees and buildings: live OSM data via Overpass API
- Camera/controller setup to support multiple devices for navigating the scene
- Built with Mozilla-orginated A-Frame library
A-Frame - XR Made Simple

<a-scene> <a-sphere position="0 1.25 -1" radius="1.25" color="#EF2D5E"></a-sphere> <a-cube position="-1 0.5 1" rotation="0 0 0" …> <a-animation attribute="rotation" … to="0 360 0"></a-animation> </a-cube> <a-cylinder position="1 0.75 1" …></a-cylinder> <a-plane …></a-plane> <a-sky color="#ECECEC"></a-sky> </a-scene>
Code Details

index.html
: JS includes, start dialog, scene, camera/controller rigmap.js
: variables, load handler, fetch from Overpass APIconversions.js
: coordinate conversionsposition-limit.js
: A-Frame component for keeping position above groundtiles.js, trees.js, buildings.js
: load/draw the 3 types of objects- KaiRo-at/vrmap at GitHub
Objectives - Recap

- Cross-Device nature of WebVR/WebXR
- Ease of use of A-Frame
- Ability to use OpenStreetMap data
Make It Your Own

tune3DMR
OSMRail
