[core] Add RendererState::{pixelForLatLng,latLngForPixel}

This commit is contained in:
Bruno de Oliveira Abinader
2018-11-13 20:42:48 +02:00
parent d44be9a91b
commit db2e1b2e5f
5 changed files with 57 additions and 8 deletions

View File

@@ -15,16 +15,22 @@ class RendererState {
public:
// Obtains a CameraOptions out of a given UpdateParameters object.
static CameraOptions getCameraOptions(UpdateParameters&, const EdgeInsets& = {});
static CameraOptions getCameraOptions(const UpdateParameters&, const EdgeInsets& = {});
// Returns whether an image with the given ID exists from a given UpdateParamters object.
static bool hasImage(UpdateParameters&, const std::string& id);
static bool hasImage(const UpdateParameters&, const std::string& id);
// Returns whether a layer with the given ID exists from a given UpdateParamters object.
static bool hasLayer(UpdateParameters&, const std::string& id);
static bool hasLayer(const UpdateParameters&, const std::string& id);
// Returns whether a source with the given ID exists from a given UpdateParamters object.
static bool hasSource(UpdateParameters&, const std::string& id);
static bool hasSource(const UpdateParameters&, const std::string& id);
// Obtains the geographical coordinate out of a given screen coordinate.
static ScreenCoordinate pixelForLatLng(const UpdateParameters&, const LatLng&);
// Obtains the screen coordinate out of a given geographical coordinate.
static LatLng latLngForPixel(const UpdateParameters&, const ScreenCoordinate&);
};
} // namespace mbgl