getDataByLocation method
Future<Data>
getDataByLocation(
- String objectId,
- String code, {
- RKZLocation? location,
- String? spotFieldName,
code
を指定して、位置情報でデータオブジェクト1件を取得します
オブジェクトにスポットオブジェクト(Spot)の項目を定義している場合、Spotの緯度経度(Spot.latitude、Spot.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);