-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMapExecuteCallback
39 lines (27 loc) · 1.13 KB
/
MapExecuteCallback
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef OSGEARTH_CEF_MAPEXECUTECALLBACK
#define OSGEARTH_CEF_MAPEXECUTECALLBACK 1
#include "ExecuteCallback"
#include "BrowserClient"
#include <osgearth/MapCallback>
#include <osgEarth/MapModelChange>
namespace osgEarth { namespace Cef
{
class MapExecuteCallback : public ExecuteCallback
{
public:
MapExecuteCallback(BrowserClient* client) : _client(client) { }
ReturnVal* execute( int64 queryId, const std::string& command, const JsonArguments &args, bool persistent, CefRefPtr<CefMessageRouterBrowserSide::Callback> callback );
private:
void ParseMapNode(osgEarth::MapNode* mapNode, osgViewer::View* view, osg::Group* root);
CefRefPtr<BrowserClient> _client;
struct MapQueryCallback: public osgEarth::MapCallback
{
std::string mapId;
CefRefPtr<CefMessageRouterBrowserSide::Callback> callback;
MapQueryCallback(const std::string& map_id, CefRefPtr<CefMessageRouterBrowserSide::Callback> queryCallback): mapId(map_id), callback(queryCallback) { }
void onMapModelChanged( const osgEarth::MapModelChange& change );
};
std::map< int64, osg::ref_ptr<MapQueryCallback> > _mapCallbacks;
};
} }
#endif