KGAPI2::StaticMapUrl

KGAPI2::StaticMapUrl Class Reference

#include <staticmapurl.h>

Public Types

enum  ImageFormat {
  PNG, PNG32, GIF, JPG,
  JPGBaseline
}
 
enum  LocationType { Undefined = -1, String, KABCAddress, KABCGeo }
 
enum  MapType { Roadmap, Satellite, Terrain, Hybrid }
 
enum  Scale { Normal = 1, TwiceBigger = 2 }
 

Public Member Functions

 StaticMapUrl ()
 
 StaticMapUrl (const QString &location, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const KContacts::Address &address, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const KContacts::Geo &geo, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const StaticMapUrl &other)
 
virtual ~StaticMapUrl ()
 
ImageFormat format () const
 
bool isValid () const
 
KContacts::Address locationAddress () const
 
KContacts::Geo locationGeo () const
 
QString locationString () const
 
LocationType locationType () const
 
MapType mapType () const
 
QList< StaticMapMarkermarkers () const
 
StaticMapUrloperator= (const StaticMapUrl &other)
 
QList< StaticMapPathpaths () const
 
Scale scale () const
 
bool sensorUsed () const
 
void setFormat (const ImageFormat format)
 
void setLocation (const QString &location)
 
void setLocation (const KContacts::Address &address)
 
void setLocation (const KContacts::Geo &geo)
 
void setMapType (const MapType type)
 
void setMarker (const StaticMapMarker &marker)
 
void setMarkers (const QList< StaticMapMarker > &markers)
 
void setPath (const StaticMapPath &path)
 
void setPaths (const QList< StaticMapPath > &paths)
 
void setScale (const Scale scale)
 
void setSensorUsed (const bool sensor)
 
void setSize (const QSize &size)
 
void setVisibleLocation (const QString &location)
 
void setVisibleLocation (const KContacts::Address &address)
 
void setVisibleLocation (const KContacts::Geo &geo)
 
void setZoomLevel (const quint32 zoom)
 
QSize size () const
 
QUrl url () const
 
KContacts::Address visibleLocationAddress () const
 
KContacts::Geo visibleLocationGeo () const
 
QString visibleLocationString () const
 
LocationType visibleLocationType () const
 
qint8 zoomLevel () const
 

Detailed Description

A class to build a URL from StaticMapMarkers and StaticMapPaths to fetch a map tile.

Author
Jan Grulich grulj[email protected][email protected][email protected]ail.c[email protected]om
Since
0.4

Definition at line 30 of file staticmapurl.h.

Constructor & Destructor Documentation

StaticMapUrl::StaticMapUrl ( )
explicit

Constructs an empty StaticMapUrl.

Definition at line 80 of file staticmapurl.cpp.

StaticMapUrl::StaticMapUrl ( const QString location,
const QSize size,
quint32  zoom,
bool  sensor 
)

Constructs a new StaticMapUrl.

Parameters
locationLocation of map center in QString
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 106 of file staticmapurl.cpp.

StaticMapUrl::StaticMapUrl ( const KContacts::Address address,
const QSize size,
quint32  zoom,
bool  sensor 
)

Constructs a new StaticMapUrl.

Parameters
addressLocation of map center in KContacts::Address
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 116 of file staticmapurl.cpp.

StaticMapUrl::StaticMapUrl ( const KContacts::Geo geo,
const QSize size,
quint32  zoom,
bool  sensor 
)

Constructs a new StaticMapUrl.

Parameters
geoLocation of map center in KContacts::Geo
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 126 of file staticmapurl.cpp.

StaticMapUrl::StaticMapUrl ( const StaticMapUrl other)

Copy constructor.

Definition at line 85 of file staticmapurl.cpp.

StaticMapUrl::~StaticMapUrl ( )
virtual

Destructor.

Definition at line 90 of file staticmapurl.cpp.

Member Function Documentation

StaticMapUrl::ImageFormat StaticMapUrl::format ( ) const

Returns map image format.

Definition at line 141 of file staticmapurl.cpp.

bool StaticMapUrl::isValid ( ) const

Returns whether map url is valid.

Definition at line 151 of file staticmapurl.cpp.

KContacts::Address StaticMapUrl::locationAddress ( ) const

Returns map center in KContacts::Address.

Returns empty KContacts::Address if location is not defined in KContacts::Address

Definition at line 194 of file staticmapurl.cpp.

KContacts::Geo StaticMapUrl::locationGeo ( ) const

Returns map center in KContacts::Geo.

Returns invalid KContacts::Geo if location is not defined in KContacts::Geo

Definition at line 208 of file staticmapurl.cpp.

QString StaticMapUrl::locationString ( ) const

Returns map center in QString.

Returns empty QString if location is not defined in QString

Definition at line 180 of file staticmapurl.cpp.

StaticMapUrl::LocationType StaticMapUrl::locationType ( ) const

Returns in which format the location is stored.

Definition at line 136 of file staticmapurl.cpp.

StaticMapUrl::MapType StaticMapUrl::mapType ( ) const

Returns type of map.

Definition at line 221 of file staticmapurl.cpp.

QList< StaticMapMarker > StaticMapUrl::markers ( ) const

Returns list of markers.

Returns empty QList if no marker were added

Definition at line 231 of file staticmapurl.cpp.

StaticMapUrl & StaticMapUrl::operator= ( const StaticMapUrl other)

Assignment operator.

Definition at line 96 of file staticmapurl.cpp.

QList< StaticMapPath > StaticMapUrl::paths ( ) const

Returns list paths.

Returns empty QList if no path were added

Definition at line 248 of file staticmapurl.cpp.

StaticMapUrl::Scale StaticMapUrl::scale ( ) const

Returns scale of map.

Definition at line 275 of file staticmapurl.cpp.

bool StaticMapUrl::sensorUsed ( ) const

Returns whether the application uses a sensor to determine user's location.

Definition at line 285 of file staticmapurl.cpp.

void StaticMapUrl::setFormat ( const ImageFormat  format)

Sets map image format (default is PNG)

Parameters
format

Definition at line 146 of file staticmapurl.cpp.

void StaticMapUrl::setLocation ( const QString location)

Defines center of the map.

Parameters
locationLocation (required when no markers are present) of center of the map in QString

Definition at line 185 of file staticmapurl.cpp.

void StaticMapUrl::setLocation ( const KContacts::Address address)

Defines center of the map.

Parameters
addressLocation (required when no markers are present) of center of the map in KContacts::Address

Definition at line 199 of file staticmapurl.cpp.

void StaticMapUrl::setLocation ( const KContacts::Geo geo)

Defines center of the map.

Parameters
geoLocation (required when no markers are present) of center of the map in KContacts::Geo

Definition at line 213 of file staticmapurl.cpp.

void StaticMapUrl::setMapType ( const MapType  type)

Sets type of map (roadmap by default)

Parameters
type

Definition at line 226 of file staticmapurl.cpp.

void StaticMapUrl::setMarker ( const StaticMapMarker marker)

Adds marker to map.

Parameters
marker

Definition at line 236 of file staticmapurl.cpp.

void StaticMapUrl::setMarkers ( const QList< StaticMapMarker > &  markers)

Adds markers to map.

Parameters
markers

Definition at line 243 of file staticmapurl.cpp.

void StaticMapUrl::setPath ( const StaticMapPath path)

Adds path to map.

Parameters
path

Definition at line 253 of file staticmapurl.cpp.

void StaticMapUrl::setPaths ( const QList< StaticMapPath > &  paths)

Adds paths to map.

Parameters
paths

Definition at line 260 of file staticmapurl.cpp.

void StaticMapUrl::setScale ( const Scale  scale)

Sets scale of map (default is 1)

Parameters
scale

Definition at line 280 of file staticmapurl.cpp.

void StaticMapUrl::setSensorUsed ( const bool  sensor)

Sets whether the application uses a sensor to determine the user's location.

Parameters
sensor

Definition at line 290 of file staticmapurl.cpp.

void StaticMapUrl::setSize ( const QSize size)

Sets size of requested map tile.

Parameters
sizeMaximum size is 640x640

Definition at line 270 of file staticmapurl.cpp.

void StaticMapUrl::setVisibleLocation ( const QString location)

Sets visible location.

You can use this instead of using center and zoom parameters.

Specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
location

Definition at line 300 of file staticmapurl.cpp.

void StaticMapUrl::setVisibleLocation ( const KContacts::Address address)

Sets visible location.

You can use this instead of using center and zoom parameters.

Visible specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
address

Definition at line 314 of file staticmapurl.cpp.

void StaticMapUrl::setVisibleLocation ( const KContacts::Geo geo)

Sets visible location.

You can use this instead of using center and zoom parameters.

Visible specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
geo

Definition at line 328 of file staticmapurl.cpp.

void StaticMapUrl::setZoomLevel ( const quint32  zoom)

Sets zoom level of the map.

Parameters
zoomZoom parameter can be in range 0 to 21 where 21 is maximum zoom level.

Definition at line 346 of file staticmapurl.cpp.

QSize StaticMapUrl::size ( ) const

Returns size of map tile.

Definition at line 265 of file staticmapurl.cpp.

QUrl StaticMapUrl::url ( ) const

Returns constructed url from all defined parameters.

Definition at line 351 of file staticmapurl.cpp.

KContacts::Address StaticMapUrl::visibleLocationAddress ( ) const

Returns visible area in KContacts::Address.

Returns empty KContacts::Address if visible area is not defined in KContacts::Address

Definition at line 309 of file staticmapurl.cpp.

KContacts::Geo StaticMapUrl::visibleLocationGeo ( ) const

Returns visible area in KContacts::Geo.

Returns empty KContacts::Geo if visible area is not defined in KContacts::Geo

Definition at line 323 of file staticmapurl.cpp.

QString StaticMapUrl::visibleLocationString ( ) const

Returns visible area in QString.

Returns empty QString if visible area is not defined in QString

Definition at line 295 of file staticmapurl.cpp.

StaticMapUrl::LocationType StaticMapUrl::visibleLocationType ( ) const

Returns type of visible location.

Definition at line 336 of file staticmapurl.cpp.

qint8 StaticMapUrl::zoomLevel ( ) const

Returns zoom level of map.

Returns -1 if zoom level is not defined

Definition at line 341 of file staticmapurl.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Nov 27 2020 23:12:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.