52 if (
$sourceCode !== self::$sourceCode || is_null($osmType) || is_null($osmId))
57 $details = $this->api->details(
59 'osm_type' => $osmType,
61 'addressdetails' => 1,
62 'accept-language' => $this->osmSource->convertLang($languageId),
66 $location = Factory::make($details)->convert(
72 && isset($details[
'centroid'])
75 $centroid = Manager::makeConverter(Manager::FORMAT_ARRAY)->read($details[
'centroid']);
77 if ($centroid instanceof
Point)
80 if ($disputedScenario)
82 $disputedScenario->adjustLocation($location);
95 $result = $this->api->autocomplete([
97 'lang' => $this->osmSource->convertLang($params[
'lang']),
98 'lat' => $params[
'lat'] ??
null,
99 'lon' => $params[
'lon'] ??
null,
104 && isset($result[
'features'])
105 && is_array($result[
'features'])
108 foreach ($result[
'features'] as $key => $feature)
110 if (!isset($feature[
'geometry']))
115 $geometry = Manager::makeConverter(Manager::FORMAT_ARRAY)->read($feature[
'geometry']);
116 if (!$geometry instanceof
Point)
122 if (!$disputeScenario)
126 $disputeScenario->adjustAutocompleteItem($result[
'features'][$key][
'properties']);