Wt  4.14.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Wt::WLeafletMap::Circle Class Reference

A circle that will be drawn on the map. More...

#include <WLeafletMap.h>

Inheritance diagram for Wt::WLeafletMap::Circle:
[legend]

Public Member Functions

 Circle (const Coordinate &center, double radius, const WPen &pen=WPen(), const WBrush &brush=WBrush())
 Create a new circle at the given position.
 
 Circle (const Coordinate &center, double radius, const WBrush &brush)
 Create a new circle at the given position.
 
void setRadius (double radius)
 Set the radius (in meters).
 
double radius () const
 Return the radius (in meters).
 
- Public Member Functions inherited from Wt::WLeafletMap::AbstractDrawnItem
void setPen (const WPen &pen)
 Set the pen used to draw the outline of the item.
 
const WPenpen () 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 WBrushbrush () 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.
 
Signalclicked ()
 Signal emitted when the user clicks on the map item.
 
SignaldoubleClicked ()
 Signal emitted when the user double-clicks on the map item.
 
SignalmouseWentDown ()
 Signal emitted when the user holds the mouse click on the map item.
 
SignalmouseWentUp ()
 Signal emitted when the user releases the mouse click on the map item.
 
SignalmouseWentOver ()
 Signal emitted when the user's mouse enters the map item.
 
SignalmouseWentOut ()
 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 >
ChildaddChild (std::unique_ptr< Child > child)
 Add a child WObject, returning a raw pointer.
 
std::unique_ptr< WObjectremoveChild (WObject *child)
 Remove a child WObject, so its lifetime is no longer determined by this WObject.
 
template<typename Child >
std::unique_ptr< ChildremoveChild (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

void createItemJS (WStringStream &ss, WStringStream &postJS, long long id) override
 Writes the JS code to create this item to the stream.
 
- Protected Member Functions inherited from Wt::WLeafletMap::AbstractDrawnItem
 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 unrender ()
 Unrender the item.
 
virtual bool needsUpdate () const
 Return whether this item needs to be updated.
 
WLeafletMapmap ()
 Returns the map this item belongs to.
 
const WLeafletMapmap () 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.
 

Detailed Description

A circle that will be drawn on the map.

Constructor & Destructor Documentation

◆ Circle() [1/2]

Wt::WLeafletMap::Circle::Circle ( const Coordinate center,
double  radius,
const WPen pen = WPen(),
const WBrush brush = WBrush() 
)

Create a new circle at the given position.

Creates a new circle at the given center with the given radius (in meters), drawn with the given pen and filled with the given brush.

◆ Circle() [2/2]

Wt::WLeafletMap::Circle::Circle ( const Coordinate center,
double  radius,
const WBrush brush 
)

Create a new circle at the given position.

Creates a new circle at the given center with the given radius (in meters) and filled with the given brush.

Member Function Documentation

◆ applyChangeJS()

void Wt::WLeafletMap::Circle::applyChangeJS ( WStringStream ss,
long long  id 
)
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::AbstractDrawnItem.

◆ createItemJS()

void Wt::WLeafletMap::Circle::createItemJS ( WStringStream ss,
WStringStream postJS,
long long  id 
)
overrideprotectedvirtual

Writes the JS code to create this item to the stream.

This method should write in ss the JS code that creates the item. The postJS stream can be used to write JS code that should be executed after the item has been created.

Implements Wt::WLeafletMap::AbstractMapItem.

◆ radius()

double Wt::WLeafletMap::Circle::radius ( ) const

Return the radius (in meters).

See also
setRadius()