Skip to content

Commit a3ab10e

Browse files
implement rotate on iOS
1 parent 8b3bfa6 commit a3ab10e

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

arcgis_map_sdk_ios/ios/Classes/ArcgisMapView.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
141141
switch (call.method) {
142142
case "zoom_in": onZoomIn(call, result)
143143
case "zoom_out": onZoomOut(call, result)
144+
case "rotate" : onRotate(call, result)
144145
case "add_view_padding": onAddViewPadding(call, result)
145146
case "set_interaction": onSetInteraction(call, result)
146147
case "move_camera": onMoveCamera(call, result)
@@ -160,7 +161,7 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
160161
case "update_is_attribution_text_visible": onUpdateIsAttributionTextVisible(call, result)
161162
case "export_image" : onExportImage(result)
162163
case "set_auto_pan_mode": onSetAutoPanMode(call, result)
163-
case "get_auto_pan_mode": onGetAutoPanMode(call, result)
164+
case "get_auto_pan_mode": onGetAutoPanMode(call, result)
164165
case "set_wander_extent_factor": onSetWanderExtentFactor( call, result)
165166
case "get_wander_extent_factor": onGetWanderExtentFactor( call, result)
166167
default:
@@ -222,6 +223,17 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
222223
result(success)
223224
}
224225
}
226+
227+
private func onRotate(_ call: FlutterMethodCall, _ result:@escaping FlutterResult) {
228+
guard let angleDouble = call.arguments as? Double else {
229+
result(FlutterError(code: "missing_data", message: "Invalid arguments", details: nil))
230+
return
231+
}
232+
233+
mapView.setViewpointRotation(angleDouble) { success in
234+
result(success)
235+
}
236+
}
225237

226238
private func onAddViewPadding(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
227239
guard let args = call.arguments as? [String: Any] else {

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ EXTERNAL SOURCES:
3030
SPEC CHECKSUMS:
3131
ArcGIS-Runtime-SDK-iOS: 6ab51d28f8831ac73c00d34998cff3a555fe304f
3232
ArcGIS-Runtime-Toolkit-iOS: e30bb45bd0bd0152bcb1ec73f9b99022a5c7d02d
33-
arcgis_map_sdk_ios: ee1d8dee42e0c11c95cd26afa2a8cb0e7a69cb23
33+
arcgis_map_sdk_ios: deb0d9d2dfedca86984c0aa81e6245eed03c8344
3434
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
35-
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
35+
geolocator_apple: d981750b9f47dbdb02427e1476d9a04397beb8d9
3636

3737
PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b
3838

39-
COCOAPODS: 1.15.2
39+
COCOAPODS: 1.16.2

example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

0 commit comments

Comments
 (0)