Z
Z
zlodiak2019-01-13 13:07:55
JavaScript
zlodiak, 2019-01-13 13:07:55

How to get house number on click?

Please tell me how can I get the house number that the user clicked on the Yandex map?
So far, I can only get the full address line of the house that the user clicked on with getAddressLine().
In this case, the address line looks something like this:

Republic of Tatarstan, Kazan, Spartakovskaya street, 1

And, theoretically, you can already pull out the house number from it. But a situation is possible when the user clicks past the house. In this case, I would like to have something simpler than parsing a string with an address

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-13
@zlodiak

So far, I can only get the full address line of the house that the user clicked on with getAddressLine()
<...>
I would like to have something simpler than parsing the address line

Uh-uh, what prevented you from scrolling down the documentation page a little lower and seeing there
Returns the building number (including building, ownership, and other additional attributes).
??

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question