| 2176 | } |
| 2177 | |
| 2178 | place_page::Info Framework::BuildPlacePageInfo(place_page::BuildInfo const & buildInfo) |
| 2179 | { |
| 2180 | place_page::Info outInfo; |
| 2181 | outInfo.SetBuildInfo(buildInfo); |
| 2182 | |
| 2183 | if (buildInfo.IsUserMarkMatchingEnabled()) |
| 2184 | { |
| 2185 | UserMark const * mark = nullptr; |
| 2186 | if (buildInfo.m_userMarkId != kml::kInvalidMarkId) |
| 2187 | { |
| 2188 | auto const & bm = GetBookmarkManager(); |
| 2189 | mark = bm.IsBookmark(buildInfo.m_userMarkId) ? bm.GetBookmark(buildInfo.m_userMarkId) |
| 2190 | : bm.GetUserMark(buildInfo.m_userMarkId); |
| 2191 | ASSERT(mark, ("There is no user mark with id", buildInfo.m_userMarkId)); |
| 2192 | } |
| 2193 | |
| 2194 | if (!mark) |
| 2195 | mark = FindUserMarkInTapPosition(buildInfo); |
| 2196 | |
| 2197 | if (mark) |
| 2198 | { |
| 2199 | FillUserMarkInfo(mark, outInfo); |
| 2200 | return outInfo; |
| 2201 | } |
| 2202 | } |
| 2203 | |
| 2204 | if (buildInfo.m_isMyPosition) |
| 2205 | { |
| 2206 | outInfo.SetSelectedObject(df::SelectionShape::OBJECT_MY_POSITION); |
| 2207 | FillMyPositionInfo(outInfo, buildInfo); |
| 2208 | SetPlacePageLocation(outInfo); |
| 2209 | return outInfo; |
| 2210 | } |
| 2211 | |
| 2212 | if (!buildInfo.m_postcode.empty()) |
| 2213 | { |
| 2214 | outInfo.SetSelectedObject(df::SelectionShape::OBJECT_POI); |
| 2215 | FillPostcodeInfo(buildInfo.m_postcode, buildInfo.m_mercator, outInfo); |
| 2216 | GetBookmarkManager().SelectionMark().SetPtOrg(outInfo.GetMercator()); |
| 2217 | SetPlacePageLocation(outInfo); |
| 2218 | |
| 2219 | return outInfo; |
| 2220 | } |
| 2221 | |
| 2222 | FeatureID selectedFeature = buildInfo.m_featureId; |
| 2223 | auto const isFeatureMatchingEnabled = buildInfo.IsFeatureMatchingEnabled(); |
| 2224 | |
| 2225 | // Using VisualParams inside FindTrackInTapPosition/GetDefaultTapRect requires drapeEngine. |
| 2226 | if (m_drapeEngine != nullptr && buildInfo.IsTrackMatchingEnabled() && |
| 2227 | !(isFeatureMatchingEnabled && selectedFeature.IsValid())) |
| 2228 | { |
| 2229 | Track::TrackSelectionInfo trackSelectionInfo; |
| 2230 | if (buildInfo.m_trackId != kml::kInvalidTrackId) |
| 2231 | { |
| 2232 | auto const & track = *GetBookmarkManager().GetTrack(buildInfo.m_trackId); |
| 2233 | track.UpdateSelectionInfo(track.GetLimitRect(), trackSelectionInfo); |
| 2234 | } |
| 2235 | else |
nothing calls this directly
no test coverage detected