I
I
ivan97272019-10-27 11:00:20
JavaScript
ivan9727, 2019-10-27 11:00:20

Random placement of tags by geolocation?

Hello. I need to get the geolocation of the client, and I need to place markers in random places near the location. How to implement it in general?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Neverov, 2019-10-27
@TTATPuOT

How to determine geolocation.
Also, Yandex.Maps has a ready-made example for determining the geolocation: https://tech.yandex.ru/maps/jsbox/2.1/geolocation
Place random marks simply with a random number generator in a range that is not very different from the client's coordinates.

A
anikavoi, 2019-10-27
@anikavoi

You get latitude and longitude coordinates.
Generate two random numbers - azimuth and distance.
Calculate the coordinates of a point from the current latitude and longitude in azimuth to this distance.
That's it - you put a dot "near" in a random place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question