Implement map projection functionality (#254)

* Implement map projection functionality

* Add missing MGL_EXPORT

* Remove the automatic copyright header
This commit is contained in:
Oleksandr Stepanov
2022-03-14 20:03:05 +06:00
committed by GitHub
parent ea234edf67
commit 6db27f50ad
15 changed files with 397 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
namespace mbgl {
class RendererFrontend;
class TransformState;
namespace style {
class Image;
@@ -110,6 +111,9 @@ public:
std::vector<ScreenCoordinate> pixelsForLatLngs(const std::vector<LatLng>&) const;
std::vector<LatLng> latLngsForPixels(const std::vector<ScreenCoordinate>&) const;
// Transform
TransformState getTransfromState() const;
// Annotations
void addAnnotationImage(std::unique_ptr<style::Image>);
void removeAnnotationImage(const std::string&);

View File

@@ -0,0 +1,30 @@
#include <mbgl/map/camera.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/geo.hpp>
#include <memory>
namespace mbgl {
class Transform;
class MapProjection : private util::noncopyable {
public:
explicit MapProjection(const Map&);
~MapProjection();
ScreenCoordinate pixelForLatLng(const LatLng&) const;
LatLng latLngForPixel(const ScreenCoordinate&) const;
void setCamera(const CameraOptions&);
CameraOptions getCamera() const;
/// Set the underneath camera so the requested coordinates are visible with the inset.
void setVisibleCoordinates(const std::vector<LatLng>&, const EdgeInsets&);
private:
std::unique_ptr<Transform> transform;
};
} // namespace mbgl