append method
Only elements contained within the range of neighboring GeoHashes of value
will be added to the filtering.
value
の隣り合うGeoHashの範囲内に含む要素のみをフィルタリングに追加します。
Implementation
TQuery append(ModelGeoValue? value) {
if (value == null) {
return _toQuery(_modelQuery);
}
final sourceNeighbors = _modelQuery.filters
.firstWhereOrNull(
(element) => element.key == key,
)
?.value as List<String>?;
final neighbors = [
if (sourceNeighbors != null) ...sourceNeighbors,
value.value.geoHash,
...value.value.neighbors,
].distinct().sortTo((a, b) => a.compareTo(b));
return _toQuery(
_modelQuery.geo(
key,
neighbors,
),
);
}