LocusMaps Mobile SDK Intro

by | Jan 29, 2019 | Mapping & Location Tech

LocusMaps on iOS showing LAX
The app screenshot above is a to-scale, bird’s eye-view of Los Angeles International Airport as rendered using the LocusLabs iOS SDK. Compiled using our advanced mapping technology and venue management system, it not only captures detailed spatial geometry, but also venue metadata such as Points of Interest and Routing options. At the end of this post, we provide a few code snippets to show just how easy it is to use our SDK to perform actions such as showing a Point of Interest, finding directions or performing a search.

Video Demo

The video below provides a short demonstration of what our SDK is capable of and you will see:

  • The detail and richness of the LAX map
  • The user’s location being identified after parking and shown via familiar blue dot on the map (iBeacon, Apple or Google mapping)
  • Directions to the check-in desk offered and the user using them to navigate to the desk
  • The departure gate shown to the user after check-in on the map
  • The user searching for restaurants close to his gate.
  • The detailed information the map provides on Points of Interest like restaurants including location, photos, description, telephone numbers, metadata like menus and many more

Zooming in

If we were to pause the map at Terminal 7 and zoom in, you would see the rich details captured by the map, including:

The Point of Interest

  • Gates
  • Shops
  • Restaurants
  • Restrooms
  • Amenities like charging stations, defibrillators, water fountains, nursing rooms and more.

Geometry

  • Basic layout
  • Thoroughfares like stairs, elevators, escalators, walkways, passages and more.

These details are available for every floor of every building for a venue.

A few more things

Some of the other great features of our SDK not shown in the video above include:

  • Pinned Map Markers which allow you to permanently highlight a Point of Interest like a lounge or check-in desk on the map
  • Recommended Places and Searches which allow users to find preset Points of Interest using only 1 or 2 taps
  • Powerful Search allowing users to find any Point of Interest by name, category or tag not only on any level of the map, but also within their immediate vicinity
  • UI & Map Customization which allow you to apply your corporate branding to the map itself as well as the user interface
  • Out of the box localization in several languages

Code Samples

Our native iOS and Android SDKs are incredibly easy to use and with just a few lines of code, our powerful and feature-rich maps are at your disposal. The sections below show how perform some of the most common tasks with our SDK.

Setup

Before using the SDK, some setup is needed, following which all tasks require only a few lines of code and in some cases as little as 1!

// Initialize the LocusLabs SDK with the accountId provided by LocusLabsLLLocusLabs.setup().accountId = “A11F4Y6SZRXH4X”// Create a new LLMapView, register as its delegate and add it as a subviewmapView = LLMapView(frame: view.bounds)mapView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]mapView?.delegate = selfview.addSubview(mapView!)// Get an instance of LLVenueDatabase, register as its delegate and load the venue LAXvenueDatabase = LLVenueDatabase(mapView: mapView)venueDatabase.delegate = self

Showing a Map

Only a single call, “loadVenueAndMap” is needed to load a map asynchronously. Our SDK not automatically keeps maps up to date but also caches them for offline use:

// Load the venue LAX asyncvenueDatabase.loadVenueAndMap(“lax”) { (_venue: LLVenue?, _map: LLMap?, _floor: LLFloor?, _marker: LLMarker?) in self.mapView?.map = _map self.venue = _venue}

Showing a Point of Interest

Showing detailed information like photos, location, etc. for a Point of Interest (POI) requires only a single method. The map will even automatically pan to and zoom in on the POI. Once a POI is showing, a user can also easily get directions from it to any other POI. In this case, we are going to show the Starbucks close to Gate 60:

func mapViewReady(_ mapView: LLMapView!) { mapView?.showPoi(byPoiId: “870”)}

Showing Directions

Showing directions between any two Points of Interest also only requires only a single method! The code below shows how to show directions from the Blue20 Bar in Terminal 6 to Gate 75A in Terminal 7. The displayed navigation interface provides the user with easy step-by-step instructions how to reach their destination.

// Get a search instance and register as its delegateself.search = self.venue!.search()self.search?.delegate = self;func search(_ search: LLSearch!, results searchResults: LLSearchResults!) { for searchResult in searchResults.results as! [LLSearchResult] { let position = searchResult.position createCircle(position: position!, radius: 10, color: UIColor.yellow)
}

Conclusion

We hope that the information above has given you an insight into the richness, power and ease of integration of our SDK. If you would like to try these ouy yourself, please use the links below.

In addition to our iOS SDK, we also offer an Android SDK and a Javascript SDK which can be integrated into any web page to provide a highly customized and feature-rich mapping experience to your customers.

Get in touch

Liked what you saw? Have questions? Want to know more?

We’d love to hear from you