woosmap_flutter 0.0.1 woosmap_flutter: ^0.0.1 copied to clipboard
Get started with the Woosmap Indoor API. View simple examples, learn the concepts, and create custom indoor maps for your site.
woosmap_flutter #
The Woosmap flutter SDK is a library that will handle communication with the Woosmap Indoor APIs.
The SDK offers an interface to manage the Indoor Mapview and to subscribe to events that happen on the map.
Please get your email and token from your pro account. You may ask for one if necessary or you can test with our developers credentials if you lack time.
Android | iOS | |
---|---|---|
Support SDK | 19+ or 20+ | 9.0+ |
Usage #
Add woosmap_flutter as a dependency in your pubspec.yaml file.
You can now display a Indoor maps by:
- Instantiating a IndoorMapViewWidget.
IndoorMapViewWidget(
wooskey: "<<YOUR WOOSMAP KEY>>",
widget: true,
indoorRendererConfiguration: const {
"centerMap": true,
"defaultFloor": 3
},
indoorWidgetConfiguration: const {
"units": "metric",
"ui": {
"primaryColor": "#318276",
"secondaryColor": "#004651",
"tertiaryColor": "#E20813"
},
},
onRef: (p0) async {
_controller = p0;
},
indoor_venue_loaded: (message) {
debugPrint(jsonEncode(message));
},
indoor_feature_selected: (message) {
debugPrint(jsonEncode(message));
},
indoor_level_changed: (message) {
debugPrint("$message");
},
indoor_user_location: (message) {
debugPrint(jsonEncode(message));
},
)))
- Accessing various functions in
IndoorMapViewWidget
- Load Indoor map
_controller.setVenue('mtp');
- Show all venue
_controller.loadIndoorMap('');
- Change Indoor Floor
_controller.setFloor(3);
- Display use position on map
_controller.setLocation(43.606573820824764, 3.92177514731884, 3, 0, true);
- Showing Information about any indoor area
_controller.highlightFeatureByRef('tropiques');
- Change Direction mode (Widget specific)
_controller.setDirectionsMode('wheelchair');
- Fetching and displaying direction
_controller.directions(DirectionParameter.fromJson({
"venueId": 'mtp',
"origin": {"lat": 43.60664187325, "lng": 3.921814671575},
"originLevel": 3,
"destination": {"lat": 43.60665215333, "lng": 3.921680093435},
"destinationLevel": 3,
"language": "en",
"units": "metric",
"mode": "wheelchair"
}))
.then((route) => {_controller.setDirections(route)});
Android Platform Settings #
This plugin uses Platform Views to embed the Android’s WebView within the Flutter app.
You should however make sure to set the correct minSdkVersion
in android/app/build.gradle
if it was previously lower than 19:
android {
defaultConfig {
minSdkVersion 19
}
}
Add the following permission inside the manifest tag in the AndroidManifest.xml
file located at android/app/src/main
.
<uses-permission android:name="android.permission.INTERNET"/>
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.