This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New key is "G" in mbgl-glfw, cycling between no puck, centered in the viewport and positioned in Tokyo.
- Loading branch information
Gali Nelle
committed
Mar 27, 2020
1 parent
fd1f870
commit 5539c79
Showing
23 changed files
with
2,092 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#pragma once | ||
|
||
#ifndef GL_GLEXT_PROTOTYPES | ||
#define GL_GLEXT_PROTOTYPES | ||
#endif | ||
|
||
#include <mapbox/cheap_ruler.hpp> | ||
#include <mapbox/geometry.hpp> | ||
#include <mbgl/gl/uniform.hpp> | ||
#include <mbgl/platform/gl_functions.hpp> | ||
#include <mbgl/style/style.hpp> | ||
#include <mbgl/util/convert.hpp> | ||
#include <mbgl/util/geo.hpp> | ||
#include <mbgl/util/mat4.hpp> | ||
#include <mbgl/util/projection.hpp> | ||
|
||
#include <array> | ||
#include <mbgl/style/expression/formatted.hpp> | ||
#include <mbgl/style/filter.hpp> | ||
#include <mbgl/style/layer.hpp> | ||
#include <mbgl/style/property_value.hpp> | ||
#include <mbgl/util/color.hpp> | ||
|
||
namespace mbgl { | ||
namespace style { | ||
|
||
class LocationComponentLayer : public Layer { | ||
public: | ||
LocationComponentLayer(const std::string& id); | ||
~LocationComponentLayer() final; | ||
|
||
// Layout properties | ||
|
||
static PropertyValue<expression::Image> getDefaultBearingImage(); | ||
const PropertyValue<expression::Image>& getBearingImage() const; | ||
void setBearingImage(const PropertyValue<expression::Image>&); | ||
|
||
static PropertyValue<expression::Image> getDefaultShadowImage(); | ||
const PropertyValue<expression::Image>& getShadowImage() const; | ||
void setShadowImage(const PropertyValue<expression::Image>&); | ||
|
||
static PropertyValue<expression::Image> getDefaultTopImage(); | ||
const PropertyValue<expression::Image>& getTopImage() const; | ||
void setTopImage(const PropertyValue<expression::Image>&); | ||
|
||
static PropertyValue<std::array<double, 3> > getDefaultLocation(); | ||
const PropertyValue<std::array<double, 3> >& getLocation() const; | ||
void setLocation(const PropertyValue<std::array<double, 3> >&); | ||
void setLocation(const LatLng& crd); // a sane overload for LatLng | ||
|
||
static PropertyValue<float> getDefaultAccuracyRadius(); | ||
const PropertyValue<float>& getAccuracyRadius() const; | ||
void setAccuracyRadius(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultBearing(); | ||
const PropertyValue<float>& getBearing() const; | ||
void setBearing(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultBearingImageSize(); | ||
const PropertyValue<float>& getBearingImageSize() const; | ||
void setBearingImageSize(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultImageTiltDisplacement(); | ||
const PropertyValue<float>& getImageTiltDisplacement() const; | ||
void setImageTiltDisplacement(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultPerspectiveCompensation(); | ||
const PropertyValue<float>& getPerspectiveCompensation() const; | ||
void setPerspectiveCompensation(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultShadowImageSize(); | ||
const PropertyValue<float>& getShadowImageSize() const; | ||
void setShadowImageSize(const PropertyValue<float>&); | ||
|
||
static PropertyValue<float> getDefaultTopImageSize(); | ||
const PropertyValue<float>& getTopImageSize() const; | ||
void setTopImageSize(const PropertyValue<float>&); | ||
|
||
// Paint properties | ||
|
||
static PropertyValue<Color> getDefaultAccuracyRadiusBorderColor(); | ||
const PropertyValue<Color>& getAccuracyRadiusBorderColor() const; | ||
void setAccuracyRadiusBorderColor(const PropertyValue<Color>&); | ||
void setAccuracyRadiusBorderColorTransition(const TransitionOptions&); | ||
TransitionOptions getAccuracyRadiusBorderColorTransition() const; | ||
|
||
static PropertyValue<Color> getDefaultAccuracyRadiusColor(); | ||
const PropertyValue<Color>& getAccuracyRadiusColor() const; | ||
void setAccuracyRadiusColor(const PropertyValue<Color>&); | ||
void setAccuracyRadiusColorTransition(const TransitionOptions&); | ||
TransitionOptions getAccuracyRadiusColorTransition() const; | ||
|
||
// Private implementation | ||
class Impl; | ||
const Impl& impl() const; | ||
|
||
Mutable<Impl> mutableImpl() const; | ||
LocationComponentLayer(Immutable<Impl>); | ||
std::unique_ptr<Layer> cloneRef(const std::string& id) const final; | ||
|
||
// Dynamic properties | ||
optional<conversion::Error> setPropertyInternal(const std::string& name, | ||
const conversion::Convertible& value) final; | ||
|
||
StyleProperty getProperty(const std::string& name) const final; | ||
Value serialize() const final; | ||
|
||
Mutable<Layer::Impl> mutableBaseImpl() const final; | ||
}; | ||
} // namespace style | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <mbgl/layermanager/layer_factory.hpp> | ||
|
||
namespace mbgl { | ||
|
||
class LocationComponentLayerFactory : public LayerFactory { | ||
protected: | ||
const style::LayerTypeInfo* getTypeInfo() const noexcept final; | ||
std::unique_ptr<style::Layer> createLayer(const std::string& id, | ||
const style::conversion::Convertible& value) noexcept final; | ||
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final; | ||
}; | ||
|
||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.