Thursday, November 20, 2014

CartoDB Layer Tutorial

CartoDB is pretty awesome for building interactive apps that need spatial data.  Most of these are web apps, but you can use CartoDB on mobile too.

Probable bed bug infestations in Manhattan

Frankly, there aren't enough mobile apps using WhirlyGlobe-Maply and CartoDB.  So I wrote a tutorial.

CartoDB Tutorial


We've got a brand new set of tutorials up on the brand new WhirlyGlobe-Maply web site.  They'll run you through setup all the way to vector selection and beyond.

The CartoDB Tutorial is one of the cool ones.  We use a MaplyQuadPagingLayer to fetch New York PLUTO data for Manhattan.

The paging layer does the dirty work of figuring out which tiles are visible.  We add a little code to fetch the data in a given tile and then display it.  The toolkit does the rest.

Synergy


It wasn't all that hard to put this together.  If you know CartoDB, you won't have much trouble using WG-Maply.  If you know WG-Maply, adding the CartoDB piece is a cinch.

I'd like to see more CartoDB based mobile apps out there.  Don't make me write them all myself.

Tuesday, November 18, 2014

Web Site & Documentation

I'm pleased to announce the WhirlyGlobe-Maply project's brand new web site.  It's been a long time in coming, but it's finally here.  And it's great!

That thing where you screen capture your web site


It's quite pretty.  We look like a real open source project now.  Other than cementing our 2014 aesthetic, there are a few practical improvements.

Documentation


We've got Tutorials!  And reference docs!  But we had those already.  Tutorials!

And then do a presentation of your web site


There are, as of writing, 17 short tutorials meant to be worked from start to finish.  Mostly.  There's some skipping around there in how you set up the project.  You'll see.

We cover everything from setting up your project to displaying tiled image maps to spheres and selection.  By the end of it, you'll have a pretty advanced, but weird looking, app.

Points to the first person to publish the tutorial as an app.  Negative points.

Partner Apps


Do you have an app that uses WhirlyGlobe-Maply?  Then you should get on the Apps page.  All you need is.
  • An app icon.
  • A link to the app store or your own page.
  • A short description.

This is totally not that thing

Right now TrailBehind's apps are at the top because this was their idea.  I'll sort it in the future, perhaps by release date or alphabetical.

Acknowledgements


This was a group effort.  Thanks go to everyone who worked on it.
  • Kim Rullo for the graphics
  • Eric Theise for the Jekyll and HTML husbandry
  • Michael Dougherty for the first cut at the documentation
What's up next is more tutorials.  I've got about a dozen more planned.  But first I want to see how people use the existing ones.  So get on out there and tutorialize!

Wednesday, November 5, 2014

eLLaWalk - Maply Android App

I'm excited to announce the very first shipping Android app using the Maply toolkit.

eLLa Walk App


The eLLa Walk app for Android (did I mention Android?) is a promotional tie-in with the eLLa fragrance from Victorinox.

The app is tied to their web site where users assemble their Instagram photos into short hikes.   They can share the hikes, search for interesting ones and generally do social networking stuff.

The development agency was coANDco in the UK and they were a delight to work with (translation: paid on time).  I did the map.  That's what I do.  Maps.

Custom Map


They're using a custom map for their app (and the site).  Built with Mapbox tools, it's a great example of branding your map tiles.

The map functionality they otherwise needed was fairly basic.  There were screen markers for the pictures, remote tile paging, some specialized caching and a full range of finger gestures.

This being Maply it's threaded to the gills.  Even if we're only adding 20 markers, we're not going to slow the main thread or the rendering thread.  Otherwise, fairly normal stuff.

Maply For Android


As I mentioned in a recent post, Maply for Android is in Beta.  The official beta #1 is out and now there's a real shipping app on the Google Play store.

Next up, some cleanup, some documentation and more Android app projects.

Tuesday, November 4, 2014

Maply Android Beta 1


I'm pleased to announce the first real beta for Maply on Android.  This includes support for x86 and ARM based devices and has been tested back to Android 4.1 (Jelly Bean).

As a reminder, Maply is the 2D interactive map (e.g. slippy map) portion of the WhirlyGlobe-Maply toolkit.

Android & Maply - The History


The bulk of Maply was ported to Android months ago.  It was paid for by a client who changed plans part way through the project.  It happens.

I needed another project to bring it home.  I don't make my own apps, I need requirements and deadlines to focus my work.  Also, money.  Money is good.

Another client came along who needed a basic, but custom map.  Can't talk about them yet, but we shipped the thing.  It's on the Google Play store and everything.

WhirlyGlobe For Android?


Thus far I've focused on Maply, rather than WhirlyGlobe.  It's easier to market on Android and that's what clients have paid for.

The C++ rendering engine is the same between the two, as is much of the internal logic.  Only the gestures are really unique.

So yes, WhirlyGlobe will be along at some point.  It depends on clients.

State of Android


If you want to try it out, look to the develop_3_0 branch on github.  There's a script to build the whole thing called build_aar.sh.  That'll compile the ARM and x86 versions of the native library and put it all in one place.  You can extract the bits you need for Android Studio without much trouble.

I'm well aware that doesn't constitute a real release.  I plan to have the Maply AAR distributed from a central Maven repository and I plan to do a user's guide.

In the mean time, there is updated reference documentation.

Android & Me


I found Android development pleasant enough.  At the suggestion of the client I switched to Android Studio.  It can't compile the NDK side of things, so I still have to use Eclipse for that.  But for Java, it's nice.  I can see novice developers using it successfully.

The Android side of mousebird consulting (inc) is now fully open for business.  If you've got an app you want to build with Maply or WhirlyGlobe, let's talk.

Monday, October 20, 2014

Dark Sky & Progressive Loading

There's a new Dark Sky for iOS out.  If you're interested in weather apps, I suggest checking it out.

Terrible weather is pretty!

Forecast.io is one of my favorite clients (translation: They pay on time), but whenever they ask for something it's going to be hard.  This was no exception.

Tile Loading


Dark Sky has a ton of custom logic in it, not to mention all the custom data they feed it.  But large parts are using standard WhirlyGlobe-Maply.  The tile loading logic, for instance, is all in there.

Let's review.  For the globe, we start loading at level 0 and work our way down.

I will reuse this at least 5 more times.

The app does something funkier when you're zoomed in, but let's ignore that.  This approach works well for the globe, but for one problem:  Animation means frames.

So let's say you're loading 20 frames of animation to show the weather changing over the course of a day.  That means you have to load each tile 20 times.  Sure, you can do it in parallel... but still.  It takes a while.

Progressive Tile Loading


Adam at Forecast.io wanted something better.  "Couldn't we load individual frames" he said?  "Sure", I said.  "Just let me renew my Xanax prescription and we'll give it a try."

And now WG-Maply can load frames progressively.  That means it'll start at your most important frame and work its way outward.  It'll load depth first, so that first frame looks good everywhere and then work outward to the less important frames.

You can set the frame priorities yourself, change them on the fly, and get feedback on what is properly loaded.  When the user moves, we start loading at the most important frame again, then work on the others.

That Sounds... Complicated


Why yes, voice in my head that may never, ever go away, it is complicated!  It's not all that hard to use, though.  You provide your tile sources as normal and let the loader do its thing.  If you want to tell the user what's going on, there's a callback for that.

Weather apps are the most obvious users here, but anything with animation is fair game.  I'd love to see some data visualization apps using this feature.

Wednesday, October 15, 2014

Facebook Open Academy Interns

We've got interns!  Let's see what they're up to.

Drop shadows with 3D?  Yes, I went there.

Wait.  What?  Interns?


Stanford and Facebook run an internship program for open source projects.  It's course credit for doing a bit of work.

As part of LocationTech, I applied for a few slots.  Last weekend I was holed up at Facebook with five talented students.  They're working on a variety of projects with WhirlyGlobe-Maply.

In a few weeks, we might do some guest posts.  For now here's an overview of what they're up to.

Web Feature Service


WFS is used by a big segment of the open source geo community.  It's for communicating vector data from server to client.  Well, the parts we care about are.  Among other projects, it's used in Geoserver.

The project is to interface WG-Maply to WFS.  Mostly that means reading Geography Markup Language (GML).

Keyhole Markup Language


KML is Google Earth's native format.  It's evolved into an interchange standard for vector and other data.  You can encode vector data and image tile sets, sure.  You can also encode behavior and paging.  Oy, it gets complex.

This project is to read KML into WG-Maply.  Probably just the static features for now.

Marine Traffic Visualization


Did you know you can see real time ship movement data online?  Cool.  But wait, it's also collected by a network of volunteers.  If that doesn't make you want to stick an antenna on your roof then you have no soul.

Anyway, the project is to visualize this data.  Perhaps with history, perhaps in real time.  We shall see.

NASA MODIS Browser


If you haven't played with the NASA (near) real time MODIS data, then go do that.  Come back when you're done.

This project is to put together a similar interface with WhirlyGlobe.  Should make a nice example, plus, NASA imagery.

Summary


This is a pretty neat set of projects.  Indeed.  Any code will be published open source.  Some will make nifty examples, others will be merged into the WhirlyGlobe contributed collection.

Wednesday, September 17, 2014

Cocoapods Support

If you're not aware of Cocoapods for iOS, you should check it out.  It's a dependency management system for source code and it's gotten quite popular.

We now have an up-to-date pod spec for WhirlyGlobe-Maply 2.3.

WhirlyGlobe-Maply Pod


All credit goes to Juan Collas who put together the latest pod (and the old one).  I contributed... absolutely nothing.  Now that's what I call open source!

The pod is named WhirlyGlobe, but Maply is in there too.  If you go looking for it on cocoapods.org you'll see this.


Using the Pod


Pods are pretty easy to use, which is kind of the point.  If you haven't installed the pod gem, go follow their instructions.

I've added a github repo that has the standard test app set up with a Podfile.  To build this, do the following:

  • git clone https://github.com/mousebird/WG-Maply-Pod-Test.git
  • cd WG-Maply-Pod-Test
  • pod install
  • Load WG-Maply-Pod-Test.xcworkspace in Xcode (not the xcodeproj)
  • Build and run

It's that easy.  I'm kind of amazed.

Setting Up Your Own


If you want to set up your own project, include the following in your podfile.

pod 'WhirlyGlobe', '2.3'
pod 'WhirlyGlobeResources'

Consult the Cocoapods site for all the rest of it, or check out the podfile in the example.  If you don't need the resources (e.g. source data), leave out the second one.

That's it.   Thanks again Juan, this is cool!