By: Cameron Mace
Displaying 3D structures and showing a user’s current location are now simple features you can add to your mobile app with a few lines of code. A couple months ago, we introduced Android Plugins. These are a collection of single-purpose libraries built on top of our mobile SDK, so you can quickly add otherwise complex features to your apps. Today, we’re sharing not one, but two additional plugins — the Location Layer plugin and Building plugin.
Easily customize 3D buildings
Using the new Buildings plugin, you can display 3D structures on top (or within) your map style. We’ve also made styling easy by implementing a handful of options to adjust the look of the buildings. For example, you can style the color and opacity of each building or even get the map’s light source which gives you complete control over the building shader.
Make maps that know where they are
We’re also introducing the Location Layer plugin. Use it to make your map location-aware by showing a users’ current location on the map.
The plugin brings all the same functionality that MyLocationView in the Map SDK has but takes it a step further. Everything is drawn using runtime styling, which in turn increases the performance, accuracy, and stability. Instead of an Android view on top of the map, we are able to draw the annotation within the map style, which means performing map gestures won’t require syncing up a view with the map. In other words, no visible lag.
Within the plugin, four modes are accessible including the tracking and compass modes you’d expect, along with a brand new navigation mode that is compatible with our Navigation SDK. It makes snapping to the route much easier allowing for a consistent view of the road ahead, smoother transitions from step to step, and fewer rerouting attempts.
Plugin and share
Alongside these new plugins, we’ve also updated our Traffic plugin with bug fixes and performance improvements. These include better compatibility with custom map styles, so you can maintain performance with your custom designs.
Stay tuned for the community-contributed plugin that will let you load a GeoJSON file from a URL, asset, or path in the device.
Take a look at the new plugin documentation to get started and share what you’re building using the hashtag #BuiltWithMapbox on Twitter. We love to feature cool projects!
New plugins for our Android SDK was originally published in Points of interest on Medium, where people are continuing the conversation by highlighting and responding to this story.