-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
36 lines (28 loc) · 992 Bytes
/
main.cpp
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
#include <rocky/vsg/Application.h>
#include <rocky/Log.h>
#include <rocky/TMSImageLayer.h>
#include <rocky/TMSElevationLayer.h>
int error(const rocky::Status& status)
{
rocky::Log()->warn("Problem: " + status.message);
return -1;
}
int main(int argc, char** argv)
{
// instantiate the engine.
rocky::Application app(argc, argv);
// add an imagery layer
auto imagery = rocky::TMSImageLayer::create();
imagery->uri = rocky::URI("https://readymap.org/readymap/tiles/1.0.0/7/");
app.mapNode->map->layers().add(imagery);
if (imagery->status().failed())
return error(imagery->status());
// add an elevation layer
auto elevation = rocky::TMSElevationLayer::create();
elevation->uri = rocky::URI("https://readymap.org/readymap/tiles/1.0.0/116/");
app.mapNode->map->layers().add(elevation);
if (elevation->status().failed())
return error(elevation->status());
// run until the user quits.
return app.run();
}