Answer the question
In order to leave comments, you need to log in
How to make the center of the map depending on the region?
There is a google map. It has a lot of marks on it. (new google.maps.LatLng). There is also a condition that works through the Yandex Maps API of the form:
else if (ymaps.geolocation.city == "Город") {
jQuery(".email").html("ящик@домен");}
var mapOptions={zoom:6,center:new google.maps.LatLng(координата,координата)}
else if (ymaps.geolocation.city == "Город") {
jQuery(".email").html("ящик@домен");
//здесь как происваивать переменной координаты и центрировать по ним;}
Answer the question
In order to leave comments, you need to log in
ymaps.ready(function () {
ymaps.geolocation.get({
provider: 'yandex'
}).then(function (result) {
var coords = result.geoObjects.get(0).geometry.getCoordinates();
/*map — ссылка на карту Google*/
map.setCenter(new google.maps.LatLng(coords[0], coords[1]));
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question