VisioMove Essential (iOS)  1.27.8
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.
  • 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 https link
// Supported icon formats are png/jpg.
"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.

The customs icons and markers needs to have only 3 colours maximum which are :

  • Red #ff0000 used as stroke color in the sdk
  • Green #00ff00 used as foreground color in the sdk
  • Blue #0000ff used as background color in the sdk

Example :

Note
VisioMove Essential uses the following prefix when naming an image:
  • "icon"(iOS)/"vme_icon"(Android)- used in the user interface
  • "marker"(iOS)/"vme_marker"(Android) - 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. To add it in the map bundle, please contact Visioglobe. Below is an example of the available attributes.

{
"version":2,
"_commentSystemDefault":"useSystemAsDefault = true allows to use system color and dark/light mode, this value can be overwritten in a theme definition",
"useSystemAsDefault":false,
"_commentThemes":"Theme list of the SDK, currently only \"light\" theme works in the SDK,
use hexadecimal colors for custom colors, \"system\" to force use system color (dark/light mode)
or use \"vg_default\" to use the SDK light mode default color",
"themes":{
"light":{
"colorPrimary":"#7a1ea1",
"colorPrimaryDark" : "#691a99",
"colorPrimaryLight" : "#b927d3",
"colorAccent" : "#68efad",
"colorAccentDark" : "vg_default",
"colorAccentInverse" : "system",
"textColorPrimary" : "#ffffff",
"textColorSecondary" : "#f3f3f3",
"buttonColorEnabled" : "vg_default",
"buttonColorEnabledInverse" : "vg_default",
"buttonColorDisabled" : "vg_default",
"buttonColorDisabledInverse" : "vg_default",
"buildingNormalPinBackground" : "vg_default",
"buildingNormalPinForeground" : "vg_default"
}
}
}

For a working example, check out the Basic demo, which reads the map bundle MapBundleTheme or the Search demo, which reads the map bundle MapBundleSystemTheme.

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];
}
A VMELocation object incorporates the position within the map as well as values indicating the accura...
Definition: VMELocation.h:18

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.
© 2022 Copyright Visioglobe, All Rights Reserved. View our Privacy Policy