Skip to content

Commit

Permalink
parse symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianBissekkou committed Nov 27, 2023
1 parent 57ba8df commit 14e3109
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions arcgis_map_sdk_ios/ios/Classes/ArcgisMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ class ArcgisMapView: NSObject, FlutterPlatformView {
}

private func onSetLocationDisplayDefaultSymbol(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
do {
guard let args = call.arguments as? [String: Any] else {
result(FlutterError(code: "missing_data", message: "Invalid arguments", details: nil))
return
}
let symbol = try GraphicsParser().parseSymbol(args)
mapView.locationDisplay.defaultSymbol = symbol
result(true)
}
catch {
result(FlutterError(code: "unknown_error", message: "Error while adding graphic. \(error)", details: nil))
return
}
result(true)
}

Expand Down
2 changes: 1 addition & 1 deletion arcgis_map_sdk_ios/ios/Classes/GraphicsParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class GraphicsParser {

// region symbol parsing

private func parseSymbol(_ dictionary: [String: Any]) throws -> AGSSymbol {
func parseSymbol(_ dictionary: [String: Any]) throws -> AGSSymbol {
let type = dictionary["type"] as! String;
switch (type) {
case "simple-marker":
Expand Down

0 comments on commit 14e3109

Please sign in to comment.