setStaticPosition method

Future<void> setStaticPosition(
  1. List<GeoPoint> geoPoints,
  2. String id
)
inherited

Implementation

Future<void> setStaticPosition(List<GeoPoint> geoPoints, String id) async {
  var listWithoutOrientation =
      geoPoints.skipWhile((p) => p is GeoPointWithOrientation).toList();
  if (listWithoutOrientation.isNotEmpty) {
    await interop
        .setStaticGeoPoints(
          mapIdMixin.toJS,
          id.toJS,
          listWithoutOrientation
              .map((point) => point.toGeoJS())
              .toList()
              .toJS,
        )
        .toDart;
  }
  if (listWithoutOrientation.length != geoPoints.length) {
    List<GeoPointWithOrientation> listOrientation =
        geoPoints.whereType<GeoPointWithOrientation>().toList();
    if (listOrientation.isNotEmpty) {
      await interop
          .setStaticGeoPointsWithOrientation(
            mapIdMixin.toJS,
            id.toJS,
            listOrientation.map((point) => point.toGeoJS()).toList().toJS,
          )
          .toDart;
    }
  }
}