[GIS] Google maps android vector rendering : how do they make it that fast

androidgoogle mapsmapstilesvector

Most of the question is in the title.

If you are on android (I believe its the same on IOS) and use maps you will notice the quality of the maps app and how the vector maps are drawn in a very fluid manner.

From what I understand, they are delivering vector tiles wich are encoded using protocol buffers which is pretty easily achievable on my side. However I was wondering how they managed to achieve real-time rendering of vector tiles in such a fluid manner.

I am currently using mapsforge to render vector based maps but the rendering times of tiles are pretty far from what I can see in google maps.

Any ideas on how I can approach such awesomness ? What kind of voodoo tricks are they using ?

Thanks for any insight !

Best Answer

Google has built their own vector map rendering engine based on OpenGL ES version 2: https://developers.google.com/maps/documentation/android/start#requiring_opengl_es_version_2

Here's a link about OpenGL ES on Android:

http://developer.android.com/training/graphics/opengl/index.html

OpenGL lets you leverage the underlying power of the GPU and get performance on par with 3D mobile game engines. Given the complexity of most high-end mobile games these days, rendering out some vector map tiles and 3D buildings seems like it would be on the low end of performance requirements.

This is why the requirement of the Maps API V2 is Android 2.2 and higher, since the OpenGL ES Android libraries also require Android 2.2 and higher.

As far as implementing your own version of this, I'd look into some general 3D rendering examples using OpenGL ES and available libraries for Android.

This SE post has some info: https://stackoverflow.com/questions/9450308/android-latest-open-source-3d-libraries-for-android

...and this: http://ntt.cc/2011/05/08/8-open-source-android-game-engines.html

I haven't seen any 3D OpenGL ES engines aimed at map rendering, but they might exist.