BaiduMapForFlutter.swift 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // BaiduMapForFlutter.swift
  3. // Runner
  4. //
  5. // Created by FancyLou on 2022/8/30.
  6. //
  7. import UIKit
  8. import Foundation
  9. import Flutter
  10. class BdiuMapForFlutterViewFactory : NSObject, FlutterPlatformViewFactory {
  11. public func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView {
  12. return BdiuMapForFlutterView(frame, viewId:viewId, args:args)
  13. }
  14. }
  15. class BdiuMapForFlutterView : NSObject, FlutterPlatformView {
  16. let frame : CGRect
  17. let viewId : Int64
  18. init(_ frame:CGRect, viewId:Int64, args: Any?){
  19. print("BdiuMapForFlutterView init frame: \(frame) viewId: \(viewId)")
  20. self.frame = frame
  21. self.viewId = viewId
  22. }
  23. func view() -> UIView {
  24. print("BdiuMapForFlutterView view" )
  25. // let mapView = BMKMapView(frame: self.frame)
  26. // mapView.zoomLevel = 17
  27. // mapView.showMapPoi = true
  28. // mapView.showIndoorMapPoi = true
  29. // return mapView
  30. let view : UIView = UIView(frame: self.frame)
  31. view.backgroundColor = UIColor.lightGray
  32. return view
  33. }
  34. }