summaryrefslogtreecommitdiff
path: root/platform/android/src/snapshotter/map_snapshot.hpp
blob: 4673dcd16e545bdcac9335daae437009c973ff14 (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
#pragma once

#include <mbgl/map/map_snapshotter.hpp>

#include <jni/jni.hpp>

#include "../geometry/lat_lng.hpp"
#include "../graphics/pointf.hpp"

#include <vector>
#include <string>

namespace mbgl {
namespace android {

class MapSnapshot {
public:

    using PointForFn = mbgl::MapSnapshotter::PointForFn;

    static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshot"; };

    static void registerNative(jni::JNIEnv&);

    static jni::Object<MapSnapshot> New(JNIEnv& env,
                                        PremultipliedImage&& image,
                                        float pixelRatio,
                                        std::vector<std::string> attributions,
                                        bool showLogo,
                                        PointForFn pointForFn);

    MapSnapshot(jni::JNIEnv&) {};
    MapSnapshot(float pixelRatio, PointForFn);
    ~MapSnapshot();

    jni::Object<PointF> pixelForLatLng(jni::JNIEnv&, jni::Object<LatLng>);

private:
    static jni::Class<MapSnapshot> javaClass;

    float pixelRatio;
    mbgl::MapSnapshotter::PointForFn pointForFn;
};

} // namespace android
} // namespace mbgl