如何使用GeoSearchControl,vuejs通过国家代码限制搜索地点?

How to restrict the search of a place by the code of the country using GeoSearchControl, vuejs?

早上好,我目前正在这家书店工作 https://github.com/fega/vue2-leaflet-geosearch 我通过以下方式应用了地点查找器的规则:

geosearchOptions: {
              provider: new OpenStreetMapProvider(),
              searchLabel: '¿Que direccion buscas?',
              showMarker: true,
              showPopup: false,
              maxMarkers: 1,
              style: 'bar',
              retainZoomLevel : true
            }

但我希望您只显示带有您的国家/地区代码的某些国家/地区的结果,因为目前我正在搜索所有地点,例如:

我只想限制一个国家。

要限制 OpenStreetMapProvider 的国家/地区搜索,请指定 countrycodes 参数。

Per documentation:

countrycodes=<countrycode>[,<countrycode>][,<countrycode>]...

Limit search results to a specific country (or a list of countries). <countrycode> should be the ISO 3166-1alpha2 code, e.g. gb for the United Kingdom, de for Germany, etc.

例子

geosearchOptions: {
    provider: new OpenStreetMapProvider({
      params: {
        countrycodes: "gb"
      }
    })
}