B
B
Bogdan2021-02-07 12:36:11
JavaScript
Bogdan, 2021-02-07 12:36:11

How to limit google maps search to a certain city?

The google maps documentation has the following example: https://jsfiddle.net/p67a8Lrs/
A search phrase is passed in the request, and in the case of the example, the result is indeed 1 (a specific museum). But how do you search only for a specific city? For example, I need to get the location of a conditional Lenin street in a particular city. How can I get the Lenin street I need, for example, in Moscow, without forcing the user to enter the name of the city?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-02-07
@freeExec

No way, you can add the name of the city to the request yourself. You can check the results yourself, how far they are from the right place and throw out completely left ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question