core: rename mbgl directories to mln (#4511)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2026-08-22 20:50:14 +02:00
committed by GitHub
parent 06fcf13d42
commit 2a8ebc4906
1924 changed files with 10489 additions and 10489 deletions

View File

@@ -0,0 +1,39 @@
#include <mln/map/map_projection.hpp>
#include <mln/map/map_impl.hpp>
#include <mln/map/transform.hpp>
#include <mln/math/angles.hpp>
namespace mln {
MapProjection::MapProjection(const Map& map)
: transform(std::make_unique<Transform>(map.getTransfromState())) {}
MapProjection::~MapProjection() = default;
ScreenCoordinate MapProjection::pixelForLatLng(const LatLng& latLng) const {
// The implementation is just a copy from map.cpp
LatLng unwrappedLatLng = latLng.wrapped();
unwrappedLatLng.unwrapForShortestPath(transform->getLatLng());
return transform->latLngToScreenCoordinate(unwrappedLatLng);
}
LatLng MapProjection::latLngForPixel(const ScreenCoordinate& pixel) const {
// The implementation is just a copy from map.cpp
return transform->screenCoordinateToLatLng(pixel);
}
void MapProjection::setCamera(const CameraOptions& camera) {
transform->jumpTo(camera);
}
CameraOptions MapProjection::getCamera() const {
return transform->getCameraOptions(std::nullopt);
}
void MapProjection::setVisibleCoordinates(const std::vector<LatLng>& latLngs, const EdgeInsets& padding) {
transform->jumpTo(mln::cameraForLatLngs(latLngs, *transform, padding)
.withBearing(util::rad2deg(-transform->getBearing()))
.withPitch(util::rad2deg(transform->getPitch())));
}
} // namespace mln