OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
poi_hover_hit.hpp
1// SPDX-FileCopyrightText: 2026 Mark G. Russell
2// SPDX-License-Identifier: MIT
3#pragma once
4#include <string>
5
6// Only currently displayed search results may acquire a POI hover highlight.
7template <typename Properties, typename Markers>
8std::string poiHoverHitId(const Properties& properties, const Markers& markers) {
9 const auto id = properties.find("id");
10 if (id == properties.end() || !id->second.template is<std::string>()) return {};
11 const auto candidate = id->second.template get<std::string>();
12 if (candidate.empty()) return {};
13 for (const auto& marker : markers)
14 if (marker.id == candidate) return candidate;
15 return {};
16}