- Make returning LatLngs unwrapped by default. - PointAnnotation and ShapeAnnotation are always wrapped so they can be selected via intersection from the visible tile boundaries. - Fixes LatLng::wrap() calculation. - Fixes LatLng::unwrapForShortestPath() calculation. The new unwrapForShortestPath algorithm unwraps the start coordinate either forwards or backwards depending on the end coordinate value, so we can always cross the antimeridian when needed and still obtain a wrapped end coordinate in the end. Fixes #4214.
22 lines
402 B
C++
22 lines
402 B
C++
#ifndef MBGL_ANNOTATION_POINT_ANNOTATION
|
|
#define MBGL_ANNOTATION_POINT_ANNOTATION
|
|
|
|
#include <mbgl/util/geo.hpp>
|
|
|
|
#include <string>
|
|
|
|
namespace mbgl {
|
|
|
|
class PointAnnotation {
|
|
public:
|
|
PointAnnotation(const LatLng& position_, const std::string& icon_ = "")
|
|
: position(position_.wrapped()), icon(icon_) {}
|
|
|
|
const LatLng position;
|
|
const std::string icon;
|
|
};
|
|
|
|
} // namespace mbgl
|
|
|
|
#endif
|