VisioMove Essential (iOS)  1.23.0
FAQ

Localizing the SDK

The SDK zip includes a VisioMoveEssentialStrings.bundle which in turn contains localized strings for SDK resources. Include the bundle in your app and enable Base Internationalization as described in Apple's documentation.

Localizing the venue

Venue content describes the venue (buildings and floors). The venue content can be modified from within VisioMapEditor, Settings->Properties->Buildings Edit. When the map is built, the venue content will be embedded in the map bundle and read automatically by the SDK.

Note
There are no APIs in the SDK for modifying the venue content. This must be done from within VisioMapEditor.

Localizing place data

The place data contains information related to the place id's within the map.

There are several ways that the place data can be injected into the SDK:

  • Embed place data in the map bundle - The place data can be populated within VisioMapEditor by using the place data dialog window Settings->File->Edit Places. It's possible to either enter all the place names manually, or to check the "Automatically generate place names" check box and empty places will have their id assigned as the place names. When the map is built, the place data content will be embedded in the map bundle and read automatically by the SDK.
    vme_edit_places_localization.png
  • Inject batch place data at start up - use the VMEPlaceInterface::updatePlaceData: selector to add place data associated with several place ids. This method should only be called within the notification VMEMapListener::mapReadyForPlaceUpdate:.
  • Inject single place data at runtime - use the VMEPlaceInterface::setPlaceID:data: selector to update place data associated with a single place id.
Note
  • If a place hasn't been given a name, then it's considered empty and will not be clickable, routable, nor will it appear within the search view.
  • When the place data is updated at runtime, it's application's responsibility to determine the appropriate locale for the current device.

Place data format

The expected format for the place data is as follows:

{
// Optional
// The localization that corresponds with places
// within the map.
// This object contains a list of place objects
"places": {
// Required
// The <id> must correspond with a place id
// within the map bundle
"<id>": {
// Required
// Display name of the place.
"name": "<string>",
// Optional
// The path of an icon that’s associated with
// the place. The icon path can be either:
// - relative to the resources directory of the
// map bundle or
// - an external http(s) link
"icon": "<string>",
// Optional
// The categories associated with the place.
// An array of category ids.
"categories": [<string>],
// Optional
// The description of the place. The
// description can be either:
// - html or
// - an external http(s) link
"description": "<string>"
}
}
// Optional
// The localization that corresponds within categories
// within the map
// This object contains a list of category objects
"categories": {
// Required
"<id>": {
// Required
// The display name of the category.
"name": "<string>",
// Optional
// The path of an icon that’s associated with
// the category. The icon path can be either:
// - relative to the resources directory of the
// map bundle or
// - an external http(s) link
"icon": "<string>"
}
}
}

Place and category icon paths

As well as referencing icons; relative to the map bundle's resource directory and via http(s), it's also possible to reference icons embedded within the application.

  • Accessing icons from the Main bundle
    NSString* lFilePath = [[NSBundle mainBundle] pathForResource:@"marker_cat_curious" ofType:@"png"];
    NSURL *lIconUrl = [NSURL URLWithString:lFilePath];
    NSDictionary *placeData = [NSDictionary dictionaryWithObjectsAndKeys:
    @"Cat - Main bundle", @"name",
    @"<b>Asset Cat</b> The icon comes from the application's main bundle", @"description",
    lIconUrl.absoluteString, @"icon",
    @[@"2", @"3", @"99"], @"categories",
    nil];

iOS 9 compatibility

If you compile your app with iOS SDK 9.0 and your place data source references http (instead of https) then you will be affected by apples App Transport Security. You will need to whitelist the domain(s) in your CMS by adding them to your application's plist. For example:

<plist version="1.0">
<dict>
...
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>http://www.example.com/</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionsAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
...
</dict>

Changing resources

It's possible to change the images packaged within VisioMoveEssential.bundle. When modifying an image, please respect it's name and pixel size (width x height). Follow the steps below:

  • Within the finder, right click on VisioMoveEssential.bundle and select "Show Package Content"
  • Modify the icons you would like to personalize.
Note
VisioMove Essential uses the following prefix when naming an image:
  • "icon" - used in the user interface
  • "marker" - added to the map's scene.

Theme the VMEMapView

It's possible to theme the VMEMapView, by adding a vg_app_theme.json file to the map bundle. Below is an example of the available attributes.

{
"version":1,
"colorPrimary":"#7a1ea1",
"colorPrimaryDark" : "#691a99",
"colorPrimaryLight" : "#9b26af",
"colorAccent" : "#68efad",
"colorAccentInverse" : "#ffffff",
"textColorPrimary" : "#ffffff",
"textColorSecondary" : "#aaaeb3",
"buttonColorEnabled" : "#7e868e",
"buttonColorEnabledInverse" : "#ffffff",
"buttonColorDisabled" : "#d4d8db",
"buttonColorDisabledInverse" : "#ffffff"
}

For a working example, check out the Basic Map, which reads the map bundle MapBundleTheme.

Integrating location services

It's very easy to integrate a location service with the VisioMove Essential SDK. The VMELocationInterface::updateLocation: API can be used to inject the users current location into the SDK.

// Below code snippet is taken from the sample's LocationMapViewController.m file
#pragma mark - CLLocationManagerDelegate
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation* lCLLocation = locations.lastObject;
VMELocation* lVMELocation = [self.mapView createLocationFromLocation:lCLLocation];
[self.mapView updateLocation:lVMELocation];
}

Once the location has been injected into the SDK, the following behavior will automatically occur:

  • An avatar (representing the location) will appear on the map
  • If the injected location has a horizontal accuracy, then a disc representing the accuracy will be added to the avatar.
  • When the place info view is displayed and the user clicks on the navigation button, the route will automatically be computed and displayed with the origin set to be the user's current location and the selected place as the destination.
  • If the "location tracker button" is enabled via the application parameters, then it will be visible in the then a blue dot will appear in it's corner to indicate that a location has been received. The button will also become enabled. The location tracker button is a toggle button for activating/deactivating the location tracker. The location tracker will be deactivated automatically if the user interacts with the map. When activated, there will be the following behavior.
    • The camera will start to track the user location. If the user changes floor/building, the camera will also change floor/building.
    • The heading of the camera will be updated to correspond with the walking direction of the user.
    • A cone indicating the facing direction of the device will be added to the base of the avatar.
vme_location_services.png
Visioglobe® 2015-2020