1.25. How to set up address search for your Web Map

In NextGIS Web you can search features on the Web Map. Results appear as you type, sorted in the following order:

  1. Coordinates.

  2. Matches found in attributes of features in the layers added to the Web Map.

  3. Addresses containing the search text.

After a click on a search result the map changes extent to show the selected feature.

Note

To find a point using the coordinates, enter the latitude and longitude in decimal degrees or degrees, minutes and seconds (make sure to use straight single and double quotes), for example:

79 W 43 N
W 79 N 43
-79 43 (the results will contain two points: 79 W, 43 N and 43 E, 79 S)
79- 43
-79 W 43 N
79°4'14.08" W 43°4'59.37" N
-79°4'14.08"  43°4'59.37"
-79 4.25 W  43 4.95 N
-79 4.25  43 4.95
79.068493 43.079920
79.068 W 43.08 N
../../_images/webmap_search_results_en.png

Pic. 1.84. Search results for «Madison». Attributes of feature #1 are opened on the map with the search text highlighted

The address search in NextGIS Web uses two data bases (providers):

  • OpenStreetMap - used by default

  • Yandex.Maps - an external geocoder with an API key

To modify address search parameters open the main menu, go to the control panel, then select “Web Map” in the “Settings” section.

../../_images/control_panel_webmap_en.png

Pic. 1.85. Selecting Web Map settings in the control panel

1.25.2. Selecting search provider

NextGIS Web can use one of the two data bases for searching: Nominatim of OpenStreetMap or Yandex.Maps API Geocoder By default the OSM search is used. To select a provider, go to control panel and open Web Map settings. In the “Address search” section use the dropdown menu of the “Provider” field to select the desired geocoder.

../../_images/address_search_provider_en.png

Pic. 1.87. Selecting address search provider

To use Yandex.Maps enter your API key in the field on the right. API keys can be obtained by users signed up on https://developer.tech.yandex.ru.

../../_images/adress_search_yandex_API_en.png

Pic. 1.88. Entering API key to use Yandex.Maps

1.25.3. Limit search area

You can limit the search area to the Web Map’s initial extent. From the control panel go to Web Map settings. Set the toggle of the “Limit by Web Map initial extent” to the on position.

../../_images/address_search_initial_extent_en.png

Pic. 1.89. Search limited to the initial extent of the Web Map

While using OSM, you can also limit the search to a particular country. In the field “Limit search results to countries” enter the code of the country using the ISO of the OSM data base: de, gb, fi etc. To find out the code, use the search on https://www.openstreetmap.org.

../../_images/address_search_country_en.png

Pic. 1.90. Search limited to the territory of France