Unact / yandex_mapkit

Flutter implementation of YandexMapkit
MIT License
132 stars 151 forks source link

I set boundingBox, but the map brings data from any point on Earth. #346

Closed Ahrorxoja closed 4 months ago

Ahrorxoja commented 4 months ago

This is my code of query suggestions

  Future<void> querySuggestions() async {
    final query = queryController.text;

    print('Suggest query: $query');

    final resultWithSession = YandexSuggest.getSuggestions(
        text: query,
        boundingBox: BoundingBox(
            northEast: Point(latitude: 38.439325, longitude: 65.848850),
            southWest: Point(latitude: 42.009998, longitude: 72.783439)),
        suggestOptions: SuggestOptions(
            suggestType: SuggestType.unspecified,
            suggestWords: true,
            userPosition: widget.point));
    resultWithSession.result.then((SuggestSessionResult value) {
      if (value.items!.isNotEmpty) {
        visibilityList = true;
        this.suggestItems = value.items;
      } else {
        visibilityList = false;
      }
      setState(() {});
    });
  }

northEast and southWest points are set.

DCrow commented 4 months ago

Hello!

boundingBox doesn't restrict the resulting suggested addresses, it only serves as a helper for better suggestions.