J
J
Julia Lis2022-01-27 23:07:29
JavaScript
Julia Lis, 2022-01-27 23:07:29

How to calculate delivery for the address field on the Yandex map?

And so friends, the question is this.
There is a Yandex map and delivery calculation. (taken from api yandex maps )

Link to the code
Now it turns out on the map there is a panel where the tasks are a fixed point A, and the ability to put a dot or enter a second address.
Then I get in the balun the calculation in km and the total cost.
How to make this panel not exist, and the second address is taken from the input, which is separately displayed.
I attached hints so that the address was pulled up.

How to make it so that when entering the address into the input, the calculation was carried out and in
id="summ" - the sum came a,
id="km" - km comes.

and remove this block so that just a dot is on the map.
61f2fb712b777162742269.png

Guru Yandex maps) I really hope for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Tkachev, 2022-01-29
@julia1990


Additionally, the searchControl element was added to the map itself - native Yandex search,
if it is not needed, remove the line myMap.controls.add(searchControl);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question