Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::MapViewRouteCollection Class Reference

MapViewRouteCollection object. More...

Inheritance diagram for gem::MapViewRouteCollection:
Collaboration diagram for gem::MapViewRouteCollection:

Public Member Functions

const RouteRenderSettingsgetRenderSettings (const Route &route) const noexcept
 Get the route custom render settings(read-only).
MapViewRouteCollectionsetRenderSettings (const Route &route, const RouteRenderSettings &settings) noexcept
 Set the route custom render settings.
const StringRef getLabel (const Route &route) const noexcept
 Get route label text.
MapViewRouteCollectionsetLabel (const Route &route, const String &text) noexcept
 Set route bubble text.
const ImageListRef getImages (const Route &route) const noexcept
 Get route bubble image list.
MapViewRouteCollectionsetImages (const Route &route, const ImageList &images) noexcept
 Set route bubble images list, see setLabel for details.
MapViewRoute getMapViewRoute (int idx) const noexcept
 Get map view route in collection by index.
MapViewRoute getMapViewRoute (const Route &route) const noexcept
 Get map view route in collection by route.
RouteCollectionadd (const Route &route, bool bMainRoute, const String &label=String(), const ImageList &images=ImageList()) noexcept
 Add or update a route in the collection.
MapViewRouteCollectionadd (const Route &route, const RouteRenderSettings &settings, const String &label=String(), const ImageList &images=ImageList()) noexcept
 Add or update a route in the collection with the given render settings.
MapViewRouteCollectionadd (const MapViewRoute &route) noexcept
 Add or update a map view route in the collection.
MapViewRouteCollectionhideLabel (const Route &route)
 Hide route label.
template<typename TCollector>
bool iterateMapViewRoutes (TCollector collector) const
 Iterate all map view routes in the collection.
int size () const noexcept
 Get number of routes in this collection.
const RouteRef getRoute (int index) const noexcept
 Get route specified by index.
int indexOf (const Route &route) const noexcept
 Get index of the specified route - return < 0 for error.
bool isMainRoute (const Route &route) const noexcept
 Check if the route is the main route in the collection.
const RouteRef getMainRoute () const noexcept
 Get the current main route.
RouteCollectionsetMainRoute (const Route &route) noexcept
 Set the route as main route in the collection.
RouteCollectionadd (const Route &route, bool bMainRoute) noexcept
 Add a route in the collection.
RouteCollectionremove (const Route &route) noexcept
 Remove the route specified by Route.
bool contains (const Route &route) const noexcept
 Check if a route object is in collection.
void clear () noexcept
 Remove all routes.
template<typename TCollector>
bool iterateRoutes (TCollector collector) const
 Iterate all routes in the collection.

Detailed Description

MapViewRouteCollection object.

Implements a routes collection for MapView preferences

Member Function Documentation

◆ add() [1/4]

MapViewRouteCollection & gem::MapViewRouteCollection::add ( const MapViewRoute & route)
inlinenoexcept

Add or update a map view route in the collection.

If the route already exists in the collection, it will be updated with the new settings

Parameters
[in]routeThe map view route to be added / updated
Returns
MapViewRouteCollection object

◆ add() [2/4]

RouteCollection & gem::MapViewRouteCollection::add ( const Route & route,
bool bMainRoute,
const String & label = String(),
const ImageList & images = ImageList() )
inlinenoexcept

Add or update a route in the collection.

If the route already exists in the collection, it will be updated with the new settings

Parameters
[in]routeThe route to be added / updated
[in]bMainRouteTrue if the route is the main route, false if it is an alternative route
[in]labelRoute label string
[in]imagesRoute label images
Returns
RouteCollection object

◆ add() [3/4]

MapViewRouteCollection & gem::MapViewRouteCollection::add ( const Route & route,
const RouteRenderSettings & settings,
const String & label = String(),
const ImageList & images = ImageList() )
inlinenoexcept

Add or update a route in the collection with the given render settings.

If the route already exists in the collection, it will be updated with the new settings

Parameters
[in]routeThe route to be added / updated
[in]settingsThe route render settings
[in]labelRoute label string
[in]imagesRoute label images
Returns
MapViewRouteCollection object

◆ add() [4/4]

RouteCollection & gem::RouteCollection::add ( const Route & route,
bool bMainRoute )
inlinenoexceptinherited

Add a route in the collection.

Parameters
[in]routeThe route to be added.
[in]bMainRouteTrue if the route is the main route, false if alternative route
Returns
RouteCollection object

◆ contains()

bool gem::RouteCollection::contains ( const Route & route) const
inlinenoexceptinherited

Check if a route object is in collection.

Parameters
[in]routeThe route to be checked
Returns
True if the route is in the collection

◆ getImages()

const ImageListRef gem::MapViewRouteCollection::getImages ( const Route & route) const
inlinenoexcept

Get route bubble image list.

Parameters
[in]routeThe route for which the images are requested
Returns
The images list

◆ getLabel()

const StringRef gem::MapViewRouteCollection::getLabel ( const Route & route) const
inlinenoexcept

Get route label text.

Parameters
[in]routeThe route for which the label wants to be retrieved
Returns
The actual label

◆ getMainRoute()

const RouteRef gem::RouteCollection::getMainRoute ( ) const
inlinenoexceptinherited

Get the current main route.

Returns
The main route in the collection

◆ getMapViewRoute() [1/2]

MapViewRoute gem::MapViewRouteCollection::getMapViewRoute ( const Route & route) const
inlinenoexcept

Get map view route in collection by route.

Parameters
[in]routeThe route attached to the map view route
Returns
The MapViewRoute object

◆ getMapViewRoute() [2/2]

MapViewRoute gem::MapViewRouteCollection::getMapViewRoute ( int idx) const
inlinenoexcept

Get map view route in collection by index.

Parameters
[in]idxThe map view route index in collection
Returns
The MapViewRoute object

◆ getRenderSettings()

const RouteRenderSettings * gem::MapViewRouteCollection::getRenderSettings ( const Route & route) const
inlinenoexcept

Get the route custom render settings(read-only).

Parameters
[in]routeThe route for which the render settings are requested
Returns
The route render settings

◆ getRoute()

const RouteRef gem::RouteCollection::getRoute ( int index) const
inlinenoexceptinherited

Get route specified by index.

Parameters
[in]indexThe index of the route in the collection
Returns
The route object

◆ hideLabel()

MapViewRouteCollection & gem::MapViewRouteCollection::hideLabel ( const Route & route)
inline

Hide route label.

Parameters
[in]routeThe route for which the label should be hidden
Returns
MapViewRouteCollection object

◆ indexOf()

int gem::RouteCollection::indexOf ( const Route & route) const
inlinenoexceptinherited

Get index of the specified route - return < 0 for error.

Parameters
[in]routeThe route to be found
Returns
The index of the route in the collection

◆ isMainRoute()

bool gem::RouteCollection::isMainRoute ( const Route & route) const
inlinenoexceptinherited

Check if the route is the main route in the collection.

Parameters
[in]routeThe route to be checked
Returns
True if the route is the main route in the collection

◆ iterateMapViewRoutes()

template<typename TCollector>
bool gem::MapViewRouteCollection::iterateMapViewRoutes ( TCollector collector) const
inline

Iterate all map view routes in the collection.

Collector should return true if iteration should continue and false if iteration should stop

Parameters
[in]collectorThe collector function
Returns
true if all routes were iterated, false if iteration was stopped

◆ iterateRoutes()

template<typename TCollector>
bool gem::RouteCollection::iterateRoutes ( TCollector collector) const
inlineinherited

Iterate all routes in the collection.

Collector should return true if iteration should continue and false if iteration should stop

Parameters
[in]collectorThe collector function
Returns
true if all routes were iterated, false if iteration was stopped

◆ remove()

RouteCollection & gem::RouteCollection::remove ( const Route & route)
inlinenoexceptinherited

Remove the route specified by Route.

Parameters
[in]routeroute in the collection
Returns
RouteCollection object

◆ setImages()

MapViewRouteCollection & gem::MapViewRouteCollection::setImages ( const Route & route,
const ImageList & images )
inlinenoexcept

Set route bubble images list, see setLabel for details.

Parameters
[in]routeThe route for which the images are set
[in]imagesThe images list
Returns
MapViewRouteCollection object

◆ setLabel()

MapViewRouteCollection & gem::MapViewRouteCollection::setLabel ( const Route & route,
const String & text )
inlinenoexcept

Set route bubble text.

Parameters
[in]routeThe route for which the label wants to be set
[in]textThe actual label

The route label supports custom icon placement inside the text by using the icon place-mark %icon index%%, e.g. "My header text %%0%%\n%%1%% my footer"

The %icon index%% must be a valid integer in images list container, i.e. 0 <= icon index < images.size()

Returns
MapViewRouteCollection object

◆ setMainRoute()

RouteCollection & gem::RouteCollection::setMainRoute ( const Route & route)
inlinenoexceptinherited

Set the route as main route in the collection.

Parameters
[in]routeThe route to be set as main route
Returns
RouteCollection object

◆ setRenderSettings()

MapViewRouteCollection & gem::MapViewRouteCollection::setRenderSettings ( const Route & route,
const RouteRenderSettings & settings )
inlinenoexcept

Set the route custom render settings.

Parameters
[in]routeThe route for which the render settings are set
[in]settingsThe route render settings
Returns
MapViewRouteCollection object

◆ size()

int gem::RouteCollection::size ( ) const
inlinenoexceptinherited

Get number of routes in this collection.

Returns
The number of routes in the collection.