getDataByLocation method

Future<Data> getDataByLocation(
  1. String objectId,
  2. String code, {
  3. RKZLocation? location,
  4. String? spotFieldName,
})

codeを指定して、位置情報でデータオブジェクト1件を取得します

オブジェクトにスポットオブジェクト(Spot)の項目を定義している場合、Spotの緯度経度(Spot.latitudeSpot.longitude)とlocationの距離が近い順番に並べ替えて抽出します。

spotFieldNameにスポットオブジェクトの項目名を指定できます。スポットオブジェクトに関連付けしている項目が1つしかない場合は省略可能です。複数の項目を指定している場合、この項目に指定した項目名をスポット検索条件として利用します。

スポットオブジェクトはAttributable.attributes{スポットオブジェクトを指定した項目名}_objectsというプロパティ名で設定されます。

スポットオブジェクトの項目がない場合、DataResult.dataが0件のレスポンスを返します。

NOTE: データが見つからない場合、PlatformExceptionをスローします

Implementation

Future<Data> getDataByLocation(String objectId, String code,
        {RKZLocation? location, String? spotFieldName}) =>
    _platform.getDataByLocation(objectId, code,
        location: location, spotFieldName: spotFieldName);