U
U
unlik2018-04-04 01:45:14
Yandex
unlik, 2018-04-04 01:45:14

Location api yandex?

There is a script that determines the user's city

window.onload = function () {
            var city = ymaps.geolocation.city;
            if (city == 'Наро-фоминск') {
                jQuery("#user-city").text('НАРО-ФОМИНСКИЙ РАЙОН');
            } else if (city == 'Апрелевка') {
                jQuery("#user-city").text('Апрелевка');
            }

And accordingly displays contacts depending on the city. But in this way the definition goes only by ip. How to enable gps?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-04-04
@freeExec

Do not read the documentation , ask a question on the toaster.
Type "Browser" will determine based on GPS if the site is on https and the user allows it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question