blob: 1b31f3db861e09e05a47381200b3b7fe50ca4e77 (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#ifndef MBGL_MAP_VECTOR_TILE_DATA
#define MBGL_MAP_VECTOR_TILE_DATA
#include <mbgl/map/tile_data.hpp>
#include <mbgl/map/tile_worker.hpp>
#include <mbgl/text/placement_config.hpp>
#include <atomic>
#include <memory>
#include <unordered_map>
namespace mbgl {
class Style;
class WorkRequest;
class FileRequest;
class GeometryTileMonitor;
class VectorTileData : public TileData {
public:
VectorTileData(const TileID&,
std::unique_ptr<GeometryTileMonitor> monitor,
std::string sourceID,
Style&,
const std::function<void()>& callback);
~VectorTileData();
Bucket* getBucket(const StyleLayer&) override;
bool parsePending(std::function<void()> callback) override;
void redoPlacement(PlacementConfig config) override;
void redoPlacement();
void cancel() override;
private:
Style& style;
Worker& worker;
TileWorker tileWorker;
std::unique_ptr<GeometryTileMonitor> monitor;
std::unique_ptr<FileRequest> tileRequest;
std::unique_ptr<WorkRequest> workRequest;
// Contains all the Bucket objects for the tile. Buckets are render
// objects and they get added by tile parsing operations.
std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
// Stores the placement configuration of the text that is currently placed on the screen.
PlacementConfig placedConfig;
// Stores the placement configuration of how the text should be placed. This isn't necessarily
// the one that is being displayed.
PlacementConfig targetConfig;
};
} // namespace mbgl
#endif
|