Using the LeapMotion Controller in location-based software

In this second part of my blog series on location-based software in JavaFX, I use a LeapMotion controller to navigate a geo map.

The May/June issue of Java Magazine contains an article I wrote on developing JavaFX Applications leveraging the LeapMotion Controller. The LeapMotion Controller is a small USB device that tracks the movement of fingers and hands. LeapMotion has its own App Store called Airspace, containing lots of applications that use this intuitive way of user interaction.

In the Java Magazine article, I explain how you can write JavaFX applications that interact with the LeapMotion Controller. Since I'm also working on location-based software, I had the idea of using the LeapMotion Controller for navigating through the map. I got lots of help from José Pereda, and in the meantime the map software I started to develop in OpenMapFX is greatly enhanced thanks to Geoff Capper. The result is a map application that allows you to browse through a map by moving your hands horizontally. Moving your hand down will zoom in, and moving your hand up will zoom out. Below is a screenshot of this application:

Leapmotion map

The OpenMapFX project is a Gradle project with a number of subprojects. One of these subprojects is called "leapmotion". It contains only 3 classes and an fxml file.

  • LeapMotionMapView contains the main application
  • SimpleLeapListener deals with events received from the LeapMotion controller
  • Overlay and the mymap.fxml file contain the overlay showing visual feedback on hand movements.

Apart from these classes, the leapmotion subproject depends on the core module for general map display functionality.

The OpenMapFX is an Open Source project, feel free to browse through the code on https://bitbucket.org/lodgon/openmapfx . Again, thanks a lot to José and Geoff for contributing. I hope more developers will follow and join the team.

 

Since we keep improving the OpenMapFX project, I created a tag named "leapmotion-b2" that contains the source code at the time when this blog entry was written.

In a next entry in this series, we will run the OpenMapFX software on Android devices. If you are interested in the OpenMapFX project, either from a technical or business perspective, feel free to drop me a note at johan at lodgon.com.

written on 03 Jun 2014 21:17.

no comments

Create comment