Use the MapBox SDK (iOS and Android) in Axway Hyperloop! This is an example of using the SDK, so this does not expose all possible API's of the SDK. See the official documentation for details.
var MapBox = require('ti.mapbox');
var mapView = MapBox.createView({
region: {
latitude: 52.020388,
longitude: 9.580078,
animated: true
}
});
myWindow.add(mapView.getInstance());var annotation = Mapbox.createAnnotation({
latitude: 52.020388,
longitude: 9.580078
});
mapView.addAnnotation(annotation.getInstance());Add the following tags to your plist-section of the tiapp.xml and change YOUR_MAPBOX_ACCESS_TOKEN to your
actual access token
<!-- Mapbox configuration -->
<key>MGLMapboxAccessToken</key>
<string>YOUR_MAPBOX_ACCESS_TOKEN</string>
<!-- General Geolocation permissions -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>Can we access your location while using the app?</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Can we access your location?</string>- Place your access token in
Resources/android/ti.mapbox/index.js - Ensure you have installed at least Gradle 4.1 by running
brew install gradleandbrew update gradle - Run gradle to pull down the necessary android libraries into
platform/android:
gradle getDeps- Now build!
appc run -p androidApache 2.0
- Hans Knöchel (Axway Appcelerator)
- Chris Williams (Axway Appcelerator)
