[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

@@ -87,6 +87,21 @@ bool HeadlessFrontend::hasSource(const std::string& id) {
return false;
}
ScreenCoordinate HeadlessFrontend::pixelForLatLng(const LatLng& coordinate) {
if (updateParameters) {
return RendererState::pixelForLatLng(*updateParameters, coordinate);
}
return ScreenCoordinate {};
}
LatLng HeadlessFrontend::latLngForPixel(const ScreenCoordinate& point) {
if (updateParameters) {
return RendererState::latLngForPixel(*updateParameters, point);
}
return LatLng {};
}
void HeadlessFrontend::setSize(Size size_) {
if (size != size_) {

View File

@@ -39,6 +39,9 @@ public:
bool hasLayer(const std::string&);
bool hasSource(const std::string&);
ScreenCoordinate pixelForLatLng(const LatLng&);
LatLng latLngForPixel(const ScreenCoordinate&);
PremultipliedImage readStillImage();
PremultipliedImage render(Map&);