updateIsLockedToScreen method

Future<bool> updateIsLockedToScreen (
  1. bool isLockedToScreen,
  2. BMFPoint screenPointToLock
)

更新是否锁定在屏幕上的位置

如果isLockedToScreen为false,screenPointToLock需要传null

Implementation

Future<bool> updateIsLockedToScreen(
    bool isLockedToScreen, BMFPoint screenPointToLock) async {
  bool ret = await BMFMapDispatcherFactory.instance.markerDispatcher
      .updateMarkerMember(this.methodChannel, {
    'id': this.Id,
    'member': 'isLockedToScreen',
    'value': isLockedToScreen,
    'screenPointToLock': screenPointToLock?.toMap()
  });

  if (ret) {
    this.isLockedToScreen = isLockedToScreen;
    this.screenPointToLock = screenPointToLock;
  }

  return ret;
}