0
Fixed

Нет геокоординат для Севастополя

Степан 3 years ago updated by Антон 3 years ago 2

Здравствуйте.
Столкнулся с такой проблемой, При вводе адреса регион/город/улица/дом, не выводит координаты если регион Севастополь, город Севастополь. При включении г. Инкерман, региона Севастополь координаты выводятся. Заранее спасибо за помощь. Прилагаю код


(function(jQuery) {

var serviceUrl="https://suggestions.dadata.ru/suggestions/api/4_1/rs",
token = "0e03e0dc1baa2315967c3d11738a1f59798348f0",
type = "ADDRESS",
$region = jQuery("#region"),
$city = jQuery("#city"),
$street = jQuery("#street"),
$house = jQuery("#house"),
$сoord = jQuery("#сoord");

function join(arr /*, separator */) {
var separator = arguments.length > 1 ? arguments[1] : ", ";
return arr.filter(function(n){return n}).join(separator);
}

function showSelected(suggestion) {
var address = suggestion.data;
jQuery("#region").val(join([
join([address.region_type_full, address.region], " "),
join([address.area_type_full, address.area], " ")
]));
jQuery("#city").val(join([
join([address.city_type_full, address.city], " "),
join([address.settlement_type_full, address.settlement], " ")
]));
jQuery("#street").val(
join([address.street_type_full, address.street], " ")
);
jQuery("#house").val(join([
join([, address.house], " "),
join([, address.block], " ")
]));

}
function getCoord(suggestion){
var address = suggestion.data;
jQuery("#coord").val(join([address.geo_lon, address.geo_lat], " "));
}
$region.suggestions({
serviceUrl: serviceUrl,
token: token,
type: type,
count: 10,
hint: false,
bounds: "region-area",
onSelect: showSelected,
onSearchComplete: getCoord
});
$city.suggestions({
serviceUrl: serviceUrl,
token: token,
type: type,
count: 10,
hint: false,
bounds: "city-settlement",
constraints: $region,
onSelect: showSelected,
onSearchComplete: getCoord
});
$street.suggestions({
serviceUrl: serviceUrl,
token: token,
type: type,
count: 10,
hint: false,
bounds: "street",
constraints: $city,
onSelect: showSelected,
onSearchComplete: getCoord
});
$house.suggestions({
serviceUrl: serviceUrl,
token: token,
type: type,
count: 10,
hint: false,
bounds: "house",
constraints: $street,
onSelect: showSelected,
onSearchComplete: getCoord
});
})(jQuery);

Answer

Answer
Fixed

Исправили.

Under review

Степан, спасибо за сообщение! Посмотрим, в чем дело, и ответим.

Answer
Fixed

Исправили.