Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | List of all members
Maps\Elements\Location Class Reference
Collaboration diagram for Maps\Elements\Location:
Collaboration graph
[legend]

Public Member Functions

 __construct (LatLongValue $coordinates)
 
 setCoordinates (LatLongValue $coordinates)
 
 setAddress ($address, $asActualLocation=true)
 
 getCoordinates ()
 
 getAddress ()
 
 hasIcon ()
 
 setIcon ($icon)
 
 setGroup ($group)
 
 getIcon ()
 
 getGroup ()
 
 hasGroup ()
 
 getInlineLabel ()
 
 setInlineLabel ($label)
 
 hasInlineLabel ()
 
 getVisitedIcon ()
 
 setVisitedIcon ($visitedIcon)
 
 hasVisitedIcon ()
 
 getJSONObject ($defText= '', $defTitle= '', $defIconUrl= '', $defGroup= '', $defInlineLabel= '', $defVisitedIcon= '')
 
- Public Member Functions inherited from Maps\Elements\BaseElement
 __construct ()
 
 getTitle ()
 
 setTitle ($title)
 
 getText ()
 
 setText ($text)
 
 getLink ()
 
 setLink ($link)
 
 getJSONObject ($defText= '', $defTitle= '')
 
 getArrayValue ()
 
 getOptions ()
 
 setOptions (ElementOptions $options)
 

Static Public Member Functions

static newFromLatLon ($lat, $lon)
 
static newTitledFromLatLon ($lat, $lon)
 
static newFromAddress ($address)
 

Additional Inherited Members

- Protected Attributes inherited from Maps\Elements\BaseElement
 $options
 

Detailed Description

Class describing a single location (geographical point).

TODO: rethink the design of this class after deciding on what actual role it has

Since
3.0

GNU GPL v2+

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Werner

Constructor & Destructor Documentation

Maps\Elements\Location::__construct ( LatLongValue  $coordinates)

Member Function Documentation

Maps\Elements\Location::getAddress ( )

Returns the address corresponding to this location. If there is none, and empty sting is returned.

Since
0.7.1
Returns
string
Maps\Elements\Location::getCoordinates ( )

Returns the locations coordinates.

Since
3.0
Returns
LatLongValue
Maps\Elements\Location::getGroup ( )

Returns the group.

Since
2.0
Returns
string
Maps\Elements\Location::getIcon ( )

Returns the icon.

Since
0.7.2
Returns
string
Maps\Elements\Location::getInlineLabel ( )
Returns
string
Since
2.0
Maps\Elements\Location::getJSONObject (   $defText = '',
  $defTitle = '',
  $defIconUrl = '',
  $defGroup = '',
  $defInlineLabel = '',
  $defVisitedIcon = '' 
)

Returns an object that can directly be converted to JS using json_encode or similar.

FIXME: complexity

Since
1.0
Parameters
string$defText
string$defTitle
string$defIconUrl
string$defGroup
string$defInlineLabel
string$defVisitedIcon
Returns
array
Maps\Elements\Location::getVisitedIcon ( )
Returns
string
Since
2.0
Maps\Elements\Location::hasGroup ( )

Returns whether Location is assigned to a group.

Since
2.0
Returns
string
Maps\Elements\Location::hasIcon ( )

Returns if there is any icon.

Since
1.0
Returns
boolean
Maps\Elements\Location::hasInlineLabel ( )
Returns
bool
Since
2.0
Maps\Elements\Location::hasVisitedIcon ( )
Returns
bool
Since
2.0
static Maps\Elements\Location::newFromAddress (   $address)
static

Creates and returns a new instance of a Location from an address.

Since
1.0
Parameters
string$address
Deprecated:
Returns
Location
Exceptions
MWException
static Maps\Elements\Location::newFromLatLon (   $lat,
  $lon 
)
static

Creates and returns a new instance of a Location from a latitude and longitude.

Since
1.0
Parameters
float$lat
float$lon
Returns
Location
static Maps\Elements\Location::newTitledFromLatLon (   $lat,
  $lon 
)
static

Creates and returns a new instance of a Location with title from a latitude and longitude.

Since
3.7
Parameters
float$lat
float$lon
Returns
Location
Maps\Elements\Location::setAddress (   $address,
  $asActualLocation = true 
)

Sets the location to an address.

Since
0.7.1
Parameters
string$address
boolean$asActualLocationWhen set to false, the location is not changed, only the address string is.
Returns
boolean Success indicator
Maps\Elements\Location::setCoordinates ( LatLongValue  $coordinates)

Sets the location to a set of coordinates. You can provide a string of raw coordinates, an array with lat and lon values and false.

Since
3.0
Parameters
LatLongValue$coordinates
Maps\Elements\Location::setGroup (   $group)

Sets the group

Since
2.0
Parameters
string$group
Maps\Elements\Location::setIcon (   $icon)

Sets the icon

Since
0.7.2
Parameters
string$icon
Maps\Elements\Location::setInlineLabel (   $label)
Parameters
$label
Since
2.0
Maps\Elements\Location::setVisitedIcon (   $visitedIcon)
Parameters
$visitedIcon
Since
2.0

The documentation for this class was generated from the following file: