OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
map_event_publisher.hpp
1// SPDX-FileCopyrightText: 2026 Mark G. Russell
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include <cstddef>
7#include <string>
8#include <zmq.hpp>
9
10class MapEventPublisher {
11public:
12 explicit MapEventPublisher(std::string endpoint);
13
14 void publishPoiSelected(
15 const std::string& name,
16 const std::string& brand,
17 const std::string& sourceClass,
18 const std::string& sourceSubclass,
19 double latitude,
20 double longitude
21 );
22
24 void publishWeatherCities(long long requestId, const std::string& cities);
25
26 void publishManualCameraInteraction();
27 void publishCameraState(double latitude, double longitude, double zoom, double bearing, double pitch);
28
29 void publishMapClick(
30 double latitude,
31 double longitude,
32 double selectionRadiusM,
33 const std::string& markerId,
34 std::size_t markerIndex
35 );
36
37 void publishPoiSearchResult(
38 const std::string& category,
39 int count,
40 double south,
41 double west,
42 double north,
43 double east
44 );
45
46private:
47 void publishJson(const char* topic, const std::string& json);
48 zmq::context_t context{1};
49 zmq::socket_t socket{context, zmq::socket_type::pub};
50};