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

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

#include <WLeafletMap.h>

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

Public Member Functions

 Polyline (const std::vector< Coordinate > &points, const WPen &pen=WPen(), const WBrush &brush=WBrush())
 Create a new polyline going trough the given points.
 
 Polyline (const std::vector< Coordinate > &points, const WBrush &brush)
 Create a new polyline going trough the given points.
 
void setPoints (const std::vector< Coordinate > &points)
 Set the points the polyline go trough.
 
const std::vector< Coordinate > & points () const
 Return the points the polyline goes trough.
 
void move (const Coordinate &pos) override
 Move the polyline.
 
- 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
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.
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 

Detailed Description

A polyline that will be drawn on the map.

A polyline is a series of connected line segments going through a series of points.

See https://leafletjs.com/reference.html#polyline

Constructor & Destructor Documentation

◆ Polyline() [1/2]

Wt::WLeafletMap::Polyline::Polyline ( const std::vector< Coordinate > &  points,
const WPen pen = WPen(),
const WBrush brush = WBrush() 
)
explicit

Create a new polyline going trough the given points.

Creates a new polyline going through the given points, drawn with the given pen and filled with the given brush.

◆ Polyline() [2/2]

Wt::WLeafletMap::Polyline::Polyline ( const std::vector< Coordinate > &  points,
const WBrush brush 
)
explicit

Create a new polyline going trough the given points.

Creates a new polyline going through the given points and filled with the given brush.

Member Function Documentation

◆ createItemJS()

void Wt::WLeafletMap::Polyline::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.

◆ move()

void Wt::WLeafletMap::Polyline::move ( const Coordinate pos)
overridevirtual

Move the polyline.

This moves the polyline so that its first point is at the given position. The other points are moved by the same offset.

Reimplemented from Wt::WLeafletMap::AbstractMapItem.

◆ points()

const std::vector< Coordinate > & Wt::WLeafletMap::Polyline::points ( ) const

Return the points the polyline goes trough.

See also
setPoints()

◆ setPoints()

void Wt::WLeafletMap::Polyline::setPoints ( const std::vector< Coordinate > &  points)

Set the points the polyline go trough.

This sets the points the polyline goes trough to the given list of points.