|
Wt
4.14.0
|
An abstract map item drawn the map. More...
#include <WLeafletMap.h>
Public Member Functions | |
| void | setPen (const WPen &pen) |
| Set the pen used to draw the outline of the item. | |
| const WPen & | pen () const |
| Return the pen used to draw the outline of the item. | |
| void | setBrush (const WBrush &brush) |
| Set the brush used to fill the item. | |
| const WBrush & | brush () const |
| Return the brush used to fill the item. | |
Public Member Functions inherited from Wt::WLeafletMap::AbstractMapItem | |
| virtual void | move (const Coordinate &pos) |
| Move the map item. | |
| Coordinate | position () const |
| Get the current position. | |
| Signal & | clicked () |
| Signal emitted when the user clicks on the map item. | |
| Signal & | doubleClicked () |
| Signal emitted when the user double-clicks on the map item. | |
| Signal & | mouseWentDown () |
| Signal emitted when the user holds the mouse click on the map item. | |
| Signal & | mouseWentUp () |
| Signal emitted when the user releases the mouse click on the map item. | |
| Signal & | mouseWentOver () |
| Signal emitted when the user's mouse enters the map item. | |
| Signal & | mouseWentOut () |
| Signal emitted when the user's mouse leaves the map item. | |
Public Member Functions inherited from Wt::WObject | |
| void | addChild (std::unique_ptr< WObject > child) |
| Add a child WObject whose lifetime is determined by this WObject. | |
| template<typename Child > | |
| Child * | addChild (std::unique_ptr< Child > child) |
| Add a child WObject, returning a raw pointer. | |
| std::unique_ptr< WObject > | removeChild (WObject *child) |
| Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
| template<typename Child > | |
| std::unique_ptr< Child > | removeChild (Child *child) |
| Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
| virtual const std::string | id () const |
| Returns the (unique) identifier for this object. | |
| virtual void | setObjectName (const std::string &name) |
| Sets an object name. | |
| virtual std::string | objectName () const |
| Returns the object name. | |
| void | resetLearnedSlots () |
| Resets learned stateless slot implementations. | |
| template<class T > | |
| void | resetLearnedSlot (void(T::*method)()) |
| Resets a learned stateless slot implementation. | |
| template<class T > | |
| WStatelessSlot * | implementStateless (void(T::*method)()) |
| Declares a slot to be stateless and learn client-side behaviour on first invocation. | |
| template<class T > | |
| WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
| Declares a slot to be stateless and learn client-side behaviour in advance. | |
| void | isNotStateless () |
| Marks the current function as not stateless. | |
| template<class T > | |
| WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
| Provides a JavaScript implementation for a method. | |
| virtual bool | resendFormData () |
| Returns whether the form data should be resent. | |
Public Member Functions inherited from Wt::Core::observable | |
| observable () noexcept | |
| Default constructor. | |
| virtual | ~observable () |
| Destructor. | |
| template<typename... Args, typename C > | |
| auto | bindSafe (void(C::*method)(Args...)) noexcept |
| Protects a method call against object destruction. | |
| template<typename... Args, typename C > | |
| auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
| Protects a const method call against object destruction. | |
| template<typename Function > | |
| auto | bindSafe (const Function &function) noexcept |
| Protects a function against object destruction. | |
Protected Member Functions | |
| AbstractDrawnItem (const Coordinate &pos, const WPen &pen=WPen(), const WBrush &brush=WBrush()) | |
| Constructor. | |
| void | addStyleOptions (Json::Object &options) const |
| Adds the style options to the given JSON object. | |
Protected Member Functions inherited from Wt::WLeafletMap::AbstractMapItem | |
| AbstractMapItem (const Coordinate &pos) | |
| Constructor. | |
| virtual void | createItemJS (WStringStream &ss, WStringStream &postJS, long long id)=0 |
| Writes the JS code to create this item to the stream. | |
| virtual void | unrender () |
| Unrender the item. | |
| virtual bool | needsUpdate () const |
| Return whether this item needs to be updated. | |
| WLeafletMap * | map () |
| Returns the map this item belongs to. | |
| const WLeafletMap * | map () const |
| Returns the map this item belongs to. | |
| virtual void | update (WStringStream &js) |
| Writes the JS to update this item to the stream. | |
| virtual void | setMap (WLeafletMap *map) |
| Set the map this item belongs to. | |
Protected Member Functions inherited from Wt::WObject | |
| virtual WStatelessSlot * | getStateless (Method method) |
| On-demand stateless slot implementation. | |
Private Member Functions | |
| void | applyChangeJS (WStringStream &ss, long long id) override |
Additional Inherited Members | |
Public Types inherited from Wt::WObject | |
| typedef void(WObject::* | Method) () |
| Typedef for a WObject method without arguments. | |
An abstract map item drawn the map.
This is the base class for all AbstractMapItems that are drawn on the map. This is an abstract class, so it should not be used directly.
|
explicitprotected |
Constructor.
Creates a new AbstractDrawnItem that is at the give pos, that is drawn with the given pen and filled with the given brush.
Since this is an abstract class, this should not be used directly.
|
protected |
Adds the style options to the given JSON object.
This adds the style options (from the pen and brush) to the given JSON object. This should be called on the options that you are adding to the drawn item at creation (in createItemJS()).
|
overrideprivatevirtual |
This method should write the JS code needed to update the item. The JS code written can use o.wtObj to refer to the WLeafletMap JS object.
Reimplemented from Wt::WLeafletMap::AbstractMapItem.
Reimplemented in Wt::WLeafletMap::Circle.
Return the brush used to fill the item.
Return the pen used to draw the outline of the item.
Set the brush used to fill the item.
This sets the brush used to fill the item.
By default, the default WBrush() is used, which means no fill.
Set the pen used to draw the outline of the item.
This sets the pen used to draw the outline of the item.
By default, the default WPen() is used.