Going beyond the map, with HERE
By Ian Delaney, Jan 14, 2013
It’s well known that HERE provides great maps at here.com and also applications for several different phone platforms. Additionally, did you also know that Nokia provides tools to help developers of all levels to create their own location applications? Let us explain.
There are two parts to this story; one for the web API (developing on the web) and the other is for the native API (developing on mobile phones). We’ll focus on the former this time.
The first stop for anybody wanting to create any kind of location app is Nokia’s developer site. Once there, you can find detailed information about all the tools Nokia provides to Web developers and for native application developers to start creating location apps.
For example, ‘Maps Mashups’ can be created relatively easily using the HERE API (Application Programming Interface) and another API from another source. Let’s use Flickr as our first example.
A heatmap is a great way to visualise a large amount of data on a map. The more items in a particular area, the more intense the colours.
Combining the HERE API with the Flickr API can display a heatmap of the most popular locations for photographs in an area. You could also use this when planning a trip to a new city to find the ‘must-see’ photo ops.
Start by creating a basic map. You’ll need to register with the Nokia Developer Portal and get your own App ID and Authentication Token first.
Once a basic map has been created, you can code it to try and determine the user’s location. This functionality isn’t supported by older versions of Internet Explorer but recent versions of all the browsers allow the user to decide whether or not to share their location with the web page.
If finding your location isn’t possible, the map will just display default location – the HERE office in Berlin.
Once you have a map and it’s centered on the user, it’s time to ask Flickr for images. You’ll need to sign up with Flickr to get your authentication token with them, too.
We can make a request to Flickr that returns the 500 most recent photos around a certain point. When the data comes back from Flickr, we gather it all together and pass it to a ‘Heatmap Overlay’.
With HERE API heatmaps, you have the ability to modify the colours any way you like so that the popular areas show green while the unpopular ones are pale yellow. Or, have them range between neon blue and pink. If you’d prefer, you can use the default rainbow colour scheme.
Once the photo data from Flickr has been added to the heatmap, we add that heatmap to the actual map. Areas where lots of photos have been taken show in orange and red while areas with fewer photos are pale yellow.
We can now see at a glance where the most popular places for photos are.
You’ll notice that you can’t actually see the actual photos, but the locations of where the photos are. Adding some extra code can populate the map with photos.
There are so many different APIs available; the number of ways they can be mashed together is limitless. Here are a few more examples.
This is exactly the same as the Flickr example but with the Instagram API instead. This would be handy to highlight areas where people are hanging out.
Use the Foursquare API and heatmaps to visualize on the map the areas where your neighbours like to hang out and the spots that people like the most in your neighbourhood.
Note: this requires a modern browser that supports the Web Audio API
This little application uses the Web Audio API together with the concert information available from the Last FM API to create an immersive, directional soundscape of a city. Fly around and discover the sounds of upcoming gigs. Best with headphones.
HERE Winter Hackathon – Jan 19th
For anybody interested in learning more, Nokia’s Location team are hosting the HERE Winter Hackathon this Saturday in the Berlin offices to encourage external developers to try and make more of these kinds of hacks. Entry is free, but you must register, as spaces are limited.
I’ve you’re a developer and you’ve got an idea of how to use HERE, go ahead and develop it and let us know what you’ve created. If however, you’re not a developer but can think of something great to create, why not share it with us here. Who knows, somebody may create it.
Use the comments section below to share with us any ideas you may have.