Skip to content

Commit

Permalink
fix motorcycle routing ios
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhdang198 committed Feb 26, 2024
1 parent 3707c5e commit fb6bdc9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
vietmap_api_key.dart
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/vietmap_flutter_navigation/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
integration_test: 13825b8a9334a850581300559b8839134b124670
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplellhh;
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplelr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -658,7 +658,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplellhh;
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplelr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -682,7 +682,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplellhh;
PRODUCT_BUNDLE_IDENTIFIER = com.example.demoPluginExamplelr;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
36 changes: 21 additions & 15 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ class _VietMapNavigationScreenState extends State<VietMapNavigationScreen> {
_navigationOption = _vietmapNavigationPlugin.getDefaultOptions();
_navigationOption.simulateRoute = false;

_navigationOption.apiKey = 'YOUR_API_KEY_HERE';
_navigationOption.apiKey =
'YOUR_API_KEY_HERE';
_navigationOption.mapStyle =
"https://maps.vietmap.vn/api/maps/light/styles.json?apikey=YOUR_API_KEY_HERE";
"https://maps.vietmap.vn/api/maps/light/styles.json?apikey=${_navigationOption.apiKey}";

_vietmapNavigationPlugin.setDefaultOptions(_navigationOption);
}
Expand All @@ -78,19 +79,24 @@ class _VietMapNavigationScreenState extends State<VietMapNavigationScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
// floatingActionButton: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// FloatingActionButton(
// onPressed: () {
// _controller?.removeAllMarkers();
// },
// child: const Icon(Icons.delete),
// ),
// FloatingActionButton(
// child: const Icon(Icons.mark_email_read), onPressed: () async {}),
// ],
// ),
floatingActionButton: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FloatingActionButton(
onPressed: () async {
var location = await Geolocator.getCurrentPosition();

_controller?.buildRoute(waypoints: [
LatLng(location.latitude, location.longitude),
LatLng(10.350045832740465, 107.07618713378906)
], profile: DrivingProfile.cycling);
},
child: const Icon(Icons.delete),
),
FloatingActionButton(
child: const Icon(Icons.mark_email_read), onPressed: () async {}),
],
),
body: SafeArea(
top: false,
child: Stack(
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/EmbeddedNavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public class FlutterMapNavigationView : NavigationFactory, FlutterPlatformView
}
else if(_navigationMode == "motorcycle")
{
mode = .automobile
mode = .init("mapbox/motorcycle")
}

let routeOptions = NavigationRouteOptions(waypoints: _wayPoints, profileIdentifier: mode)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: vietmap_flutter_navigation
description: A Flutter plugin for find a route and navigating user using Vietmap api and vietmap_flutter_gl. Supports Android and iOS.
version: 2.0.0-beta
version: 2.0.1-beta
repository: https://github.com/vietmap-company/vietmap-flutter-navigation/pre-release-v2.0.0
homepage: https://github.com/vietmap-company

Expand Down

0 comments on commit fb6bdc9

Please sign in to comment.