Class Map24.Location
Object
|
+--Map24.MapObject
|
+--Map24.Location
- class Map24.Location
- extends Map24.MapObject.
This class represents a location that can be used to mark a certain point on the map.
A location is represented on the map with a logo that can either be set with a URL in the LogoURL parameter or with the ID of a symbol in
a given symbol table (SymbolId parameter).
It is possible to add a description for the location that will be shown in a simple tooltip.
Alternatively a HTML tooltip can be added to the location. The Map24.Location object allows to define the size, content, layout, and the event types
for showing and hiding the tooltip.
Optionally, you can also specify a URL for the location. Then the location will be displayed in a button style (3D frame).
When clicking on the location's button the URL is shown in a new frame (target frame). Furthermore, mouse events can be specified for a location.
The Map24 AJAX API returns an array of Map24.Location objects as result of a Map24.GeocoderServiceStub.geocode, Map24.GeocoderServiceStub.reverseGeocode,
Map24.RoutingServiceStub.calculateRoute, or Map24.ProximityServiceStub.findCustomerLocations function.
In addition it is possible to pass Map24.Location objects as start, destination, and via points of a route
in a Map24.RoutingServiceStub.calculateRoute function. If the Map24.Location object represents a via point, it is possible
to specify how far the route can be away from the via point. For this purpose Map24.Location provides the setTransitRadius() function.
The transit radius can be accessed with getTransitRadius(). The transit radius property is only used in this particular case.
Defined in Location.js
| Field Summary |
static boolean |
ShowOnlyOneTooltip
If this flag is set to true, only one tooltip will be visible at a time. |
| Method Summary |
void |
addListener (event, listener, additionalParams)
Adds an event listener to the location. ... |
void |
attachLabel (label, visibilty)
Attaches a label to the location. ... |
void |
commit (show)
Commits all property values that are currently set in the location. ... |
Array |
getAdditionalPropertiesKeys ()
Returns the keys of all user-defined properties. ... |
mixed |
getAdditionalProperty (name)
Returns the value of the specified property. ... |
...CanvasReferencePoint |
getCanvasReferencePoint ()
Returns the reference point where to put the location. ... |
String |
getCity ()
Returns the city in which the object is located. ... |
String |
getCountry ()
Returns the country of the location's address. ... |
String |
getCounty ()
Returns the county of the location's address. ... |
String |
getDescription ()
Returns the description of the location. ... |
String |
getDistrict ()
Returns the district of the location's address. ... |
Integer |
getHouseNo ()
Returns the house number of the location's address. ... |
Float |
getLatitude ()
Returns the latitude of the location's coordinate. ... |
String |
getLogoURL ()
Returns the URL of the logo that represents the location on the map. ... |
String |
getLogoURLOnMouseOver ()
Returns the URL of the logo that is shown when the mouse moves over the location. ... |
Float |
getLongitude ()
Returns the longitude of the location's coordinate. ... |
String |
getName ()
Returns the name of the location's address. ... |
...MapObjectOrientation |
getOrientation ()
Returns the orientation of the location relative to its associated map coordinate or CanvasReferencePoint. ... |
String |
getState ()
Returns the state of the location's address. ... |
Integer |
getStreet ()
Returns the street of the location's address. ... |
Integer |
getSymbolId ()
Returns the ID of a symbol that represents the location on the map. ... |
Integer |
getSymbolIdOnMouseOver ()
Returns the ID of the symbol to be displayed as long as the mouse hovers above a map object that has no logo URL assigned. ... |
String |
getTargetFrame ()
Returns the target frame in which the location's URL is shown. A URL can be assigned to a location with setURL(). ... |
Integer |
getTooltipClose ()
Returns the type of the event for closing the tooltip. ... |
String |
getTooltipContent ()
Returns the content of the tooltip. ... |
Integer |
getTooltipLayout ()
Returns the tooltip's layout. ... |
Integer |
getTooltipOpen ()
Returns the type of the event for displaying the tooltip. ... |
Integer |
getTooltipSize ()
Returns the tooltip's size. ... |
Float |
getTransitRadius ()
Returns the transit radius. ... |
String |
getURL ()
Returns the URL that is called when the user clicks on the location. ... |
String |
getZip ()
Returns the zip code of the location's address. ... |
void |
hide ()
Hides the location. ... |
void |
remove ()
Removes the location object. ... |
boolean |
removeAttachedLabel ()
Deletes the attached label. ... |
void |
removeListener (event, listener)
Removes event listener assigned to the location. ... |
void |
setAdditionalProperty (name, value)
Adds a user-defined property with the given name to the location. ... |
void |
setCanvasReferencePoint (CanvasReferencePoint)
Sets the reference point where to put the location, if it should be located on the canvas instead of beeing located on the map. ... |
void |
setCity (City)
Sets the city in which the object is located. ... |
void |
setCountry (Country)
Sets the country of the location's address. ... |
void |
setCounty (County)
Sets the county of the location's address. ... |
void |
setDescription (String)
Sets the description of the location. ... |
void |
setDistrict (District)
Sets the district of the location's address. ... |
void |
setHouseNo (HouseNo)
Sets the house number of the location's address. ... |
void |
setLatitude (Latitude)
Sets the latitude of the location's coordinate. ... |
void |
setLogoURL (LogoURL)
Sets the URL of the logo that represents the location on the map. ... |
void |
setLogoURLOnMouseOver (LogoURLOnMouseOver)
Sets the URL of the logo that is shown when the mouse moves over the location. ... |
void |
setLongitude (Longitude)
Sets the longitude of the location's coordinate. ... |
void |
setName (Name)
Sets the name of the location's address. ... |
void |
setOrientation (Orientation)
Sets the orientation of the location relative to its associated map coordinate or CanvasReferencePoint. ... |
void |
setState (State)
Sets the state of the location's address. ... |
void |
setStreet (Street)
Sets the street of the location's address. ... |
void |
setSymbolId (SymbolId)
Sets the ID of a symbol that represents the location on the map. ... |
void |
setSymbolIdOnMouseOver (SymbolIDOnMouseOver)
Sets the ID of the symbol to be displayed as long as the mouse hovers above a map object that has no logo URL assigned. ... |
void |
setTargetFrame (TargetFrame)
If a URL is given, it will be shown in the specified target frame. ... |
void |
setTooltipClose (TooltipClose)
Sets the type of the event for closing the tooltip. The following events are available: "OnMouseOver", "OnClick", "OnMouseOut". ... |
void |
setTooltipContent (TooltipContent)
Sets the content of the tooltip. ... |
void |
setTooltipLayout (Layout)
Sets the tooltip's layout. ... |
void |
setTooltipOpen (TooltipOpen)
Sets the type of the event for displaying the tooltip. The following events are available: "OnMouseOver", "OnClick", "OnMouseOut". ... |
void |
setTooltipSize (Size)
Sets the tooltip's size. ... |
void |
setTransitRadius (TransitRadius)
Sets the transit radius. ... |
void |
setURL (URL)
Sets the URL that is called when the user clicks on the location. ... |
void |
setZip (Zip)
Sets the zip code of the location's address. ... |
ShowOnlyOneTooltip
static boolean ShowOnlyOneTooltip
If this flag is set to true, only one tooltip will be visible at a time.
Map24.Location
Map24.Location (_params)
Parameters:
Hashtable _params - Details see below:
| Key |
Type |
Description |
| Longitude (mandatory) |
Float |
The longitude of the location's coordinate. |
| Latitude (mandatory) |
Float |
The latitude of the location's coordinate. |
| LogoURL (optional) |
String |
The URL of the logo that represents the Map24 Location on the map. |
| SymbolId (optional) |
Integer |
If the LogoURL parameter is not set, the symbol ID is used to represent the Map24 Location on the map. (Applet only) |
| Description (optional) |
String |
The description of the object, which is shown as well as tooltip if you mouseover the object. (Applet only) |
| URL (optional) |
String |
The URL to call if the object is clicked. (Applet only) |
| TargetFrame (optional) |
String |
The name of the frame where the assigned URL should be opened, if the object is clicked. (Applet only) |
| LogoURLOnMouseOver (optional) |
String |
The URL of the logo that is shown when the mouse moves over the location. |
| SymbolIdOnMouseOver (optional) |
Integer |
The symbol id of the symbol to be displayed as long as the mouse hovers above a map object that has no logo URL assigned. |
| CanvasReferencePoint (optional) |
Map24.WebServices.CanvasReferencePoint |
The reference point where to put the object, if it should be located on the canvas instead of beeing located on the map. (Applet only) |
| Orientation (optional) |
Map24.WebServices.MapObjectOrientation |
Orientation of the location relative to its associated map coordinate or CanvasReferencePoint. (Applet only) |
| TooltipContent (optional) |
String |
Content of the HTML object. The content must be formatted with MHTML (see Map24.HTMLObject). |
| TooltipLayout (optional) |
String |
Layout of the HTML object. The following predefined layouts are available: LAYOUT_PLAIN, LAYOUT_BALLOON, and LAYOUT_NONE(default). |
| TooltipSize (optional) |
String |
Size of the HTML object. The following predefined sizes are available: SIZE_S, SIZE_M, SIZE_L. SIZE_M is the default size. |
| TooltipOpen (optional) |
String |
Type of the event for opening the tooltip. The following events are available: "OnMouseOver" (default), "OnClick", "OnDblClick", "OnMouseOut" |
| TooltipClose (optional) |
String |
Type of the event for closing the tooltip. The following events are available: "OnMouseOut", "OnMouseOver", "OnClick" |
| TransitRadius (optional) |
Float |
If the location is used as a via point in a route, a transit radius can be set to specify how far the route can be away from the via point. |
| MinMPP (optional) |
Integer |
The minimum meters per pixel (mpp) value from which on the map object is shown. |
| MaxMPP (optional) |
Integer |
The maximum meters per pixel (mpp) value above which the map object is not displayed any more. |
addListener
void addListener (event, listener, additionalParams)
Adds an event listener to the location.
Parameters:
String event - The event type that causes the listener to be called. The following events are available: "OnMouseOver", "OnClick", "OnMouseOut".
Function listener - The function that is called on the corresponding event.
Hashtable additionalParams - Optional additional parameters that are passed to the function which is defined in the listener parameter.
attachLabel
void attachLabel (label, visibilty)
Attaches a label to the location.
Parameters:
Map24.Label label - Map24.Label object to be attached to the location.
Boolean visibilty - (optional) If true (default), the label is displayed on the map. Otherwise, the label is hidden.
commit
void commit (show)
Commits all property values that are currently set in the location.
Parameters:
Boolean show - If true (default), the location is shown on the map. If false, the location is not shown. In case of an update of an already shown location,
the location is not updated on the map.
getAdditionalPropertiesKeys
Array getAdditionalPropertiesKeys ()
Returns the keys of all user-defined properties.
Returns:
Array The value of the property.
getAdditionalProperty
mixed getAdditionalProperty (name)
Returns the value of the specified property.
Parameters:
String name - The name of the property to access.
Returns:
mixed The value of the property.
Throws:
Map24.Exception.InvalidArgument
getCanvasReferencePoint
...CanvasReferencePoint getCanvasReferencePoint ()
Returns the reference point where to put the location.
Returns:
{Map24.WebServices.CanvasReferencePoint }
The reference point.
getCity
String getCity ()
Returns the city in which the object is located.
getCountry
String getCountry ()
Returns the country of the location's address.
getCounty
String getCounty ()
Returns the county of the location's address.
getDescription
String getDescription ()
Returns the description of the location.
Returns:
String Description of the location.
getDistrict
String getDistrict ()
Returns the district of the location's address.
getHouseNo
Integer getHouseNo ()
Returns the house number of the location's address.
Returns:
Integer The house number.
getLatitude
Float getLatitude ()
Returns the latitude of the location's coordinate.
Returns:
Float The latitude of the location's coordinate.
getLogoURL
String getLogoURL ()
Returns the URL of the logo that represents the location on the map.
Returns:
String The URL of the logo that represents the location on the map.
getLogoURLOnMouseOver
String getLogoURLOnMouseOver ()
Returns the URL of the logo that is shown when the mouse moves over the location.
Returns:
String }
URL of the logo that is shown when the mouse moves over the location.
getLongitude
Float getLongitude ()
Returns the longitude of the location's coordinate.
Returns:
Float The longitude of the location's coordinate.
getName
String getName ()
Returns the name of the location's address.
getOrientation
...MapObjectOrientation getOrientation ()
Returns the orientation of the location relative to its associated map coordinate or CanvasReferencePoint.
Returns:
{Map24.WebServices.MapObjectOrientation }
The orientation of the location.
getState
String getState ()
Returns the state of the location's address.
getStreet
Integer getStreet ()
Returns the street of the location's address.
getSymbolId
Integer getSymbolId ()
Returns the ID of a symbol that represents the location on the map.
Returns:
Integer The Symbol ID assigned to this location.
getSymbolIdOnMouseOver
Integer getSymbolIdOnMouseOver ()
Returns the ID of the symbol to be displayed as long as the mouse hovers above a map object that has no logo URL assigned.
getTargetFrame
String getTargetFrame ()
Returns the target frame in which the location's URL is shown. A URL can be assigned to a location with setURL().
Returns:
String Target frame in which the location's URL is shown.
getTooltipClose
Integer getTooltipClose ()
Returns the type of the event for closing the tooltip.
Returns:
Integer The event for closing the tooltip.
getTooltipContent
String getTooltipContent ()
Returns the content of the tooltip.
Returns:
String The tooltip's content.
getTooltipLayout
Integer getTooltipLayout ()
Returns the tooltip's layout.
Returns:
Integer The tooltip's layout.
getTooltipOpen
Integer getTooltipOpen ()
Returns the type of the event for displaying the tooltip.
Returns:
Integer The event for displaying the tooltip.
getTooltipSize
Integer getTooltipSize ()
Returns the tooltip's size.
Returns:
Integer The tooltip's size.
getTransitRadius
Float getTransitRadius ()
Returns:
Float The transit radius.
getURL
String getURL ()
Returns the URL that is called when the user clicks on the location.
Returns:
String URL that is called when the user clicks on the location.
getZip
String getZip ()
Returns the zip code of the location's address.
hide
void hide ()
remove
void remove ()
Removes the location object.
removeAttachedLabel
boolean removeAttachedLabel ()
Deletes the attached label.
Returns:
boolean Returns true if a Map24.Label object was attached to the location and successfully removed, false otherwise.
removeListener
void removeListener (event, listener)
Removes event listener assigned to the location.
Parameters:
String event - The event type that causes the listener to be called.
String listener - The listener to be removed.
setAdditionalProperty
void setAdditionalProperty (name, value)
Adds a user-defined property with the given name to the location.
Parameters:
String name - The name of the property.
value - The value of the property.
setCanvasReferencePoint
void setCanvasReferencePoint (CanvasReferencePoint)
Sets the reference point where to put the location, if it should be located on the canvas instead of beeing located on the map.
setCity
void setCity (City)
Sets the city in which the object is located.
setCountry
void setCountry (Country)
Sets the country of the location's address.
Parameters:
String Country - The country.
setCounty
void setCounty (County)
Sets the county of the location's address.
Parameters:
String County - The county.
setDescription
void setDescription (String)
Sets the description of the location.
setDistrict
void setDistrict (District)
Sets the district of the location's address.
Parameters:
String District - The district.
setHouseNo
void setHouseNo (HouseNo)
Sets the house number of the location's address.
Parameters:
String HouseNo - The house number.
setLatitude
void setLatitude (Latitude)
Sets the latitude of the location's coordinate.
Parameters:
Float Latitude - The latitude of the location's coordinate.
setLogoURL
void setLogoURL (LogoURL)
Sets the URL of the logo that represents the location on the map.
Parameters:
String LogoURL - The URL of the logo that represents the Map24 Location on the map.
setLogoURLOnMouseOver
void setLogoURLOnMouseOver (LogoURLOnMouseOver)
Sets the URL of the logo that is shown when the mouse moves over the location.
Parameters:
Integer LogoURLOnMouseOver
setLongitude
void setLongitude (Longitude)
Sets the longitude of the location's coordinate.
Parameters:
Float Longitude - The longitude of the location's coordinate.
setName
void setName (Name)
Sets the name of the location's address.
setOrientation
void setOrientation (Orientation)
Sets the orientation of the location relative to its associated map coordinate or CanvasReferencePoint.
setState
void setState (State)
Sets the state of the location's address.
Parameters:
String State - The state.
setStreet
void setStreet (Street)
Sets the street of the location's address.
Parameters:
String Street - The street.
setSymbolId
void setSymbolId (SymbolId)
Sets the ID of a symbol that represents the location on the map.
If the logoURL parameter is not specified, it is possible to specify the ID of a symbol in an image library.
All image libraries are stored in the resource directory. Each image library contains 10 images For example,
the third image in a library called symMap24_2.gif is specified with 23 (2 is the number of the image library
and 3 is the number of the image).
setSymbolIdOnMouseOver
void setSymbolIdOnMouseOver (SymbolIDOnMouseOver)
Sets the ID of the symbol to be displayed as long as the mouse hovers above a map object that has no logo URL assigned.
Parameters:
Integer SymbolIDOnMouseOver
setTargetFrame
void setTargetFrame (TargetFrame)
If a URL is given, it will be shown in the specified target frame.
This function sets the target frame in which the URL is shown.
Parameters:
String TargetFrame - The target frame in which the URL is shown.
setTooltipClose
void setTooltipClose (TooltipClose)
Sets the type of the event for closing the tooltip. The following events are available: "OnMouseOver", "OnClick", "OnMouseOut".
Parameters:
Integer TooltipClose - Type of the event for closing the tooltip.
setTooltipContent
void setTooltipContent (TooltipContent)
Sets the content of the tooltip.
Map24 HTML Objects display HTML formatted text, images, tables, and forms in a separate frame that is
pushed onto the map. HTML objects support the most common HTML tags and attributes.
The Map24 specific subset of HTML is called "MHTML". A detailed description of MHTML is provided in the section about MHTML in the tutorials.
Parameters:
String TooltipContent - The tooltip's content.
setTooltipLayout
void setTooltipLayout (Layout)
Parameters:
Integer Layout - Layout of the tooltip.
setTooltipOpen
void setTooltipOpen (TooltipOpen)
Sets the type of the event for displaying the tooltip. The following events are available: "OnMouseOver", "OnClick", "OnMouseOut".
Parameters:
Integer TooltipOpen - Type of the event for displaying the tooltip.
setTooltipSize
void setTooltipSize (Size)
Sets the tooltip's size.
Possible sizes:
- Map24.MapObject.SIZE_S: Small size.
- Map24.MapObject.SIZE_M: Medium size.
- Map24.MapObject.SIZE_L: Large size.
Parameters:
Integer Size - Size of the tooltip.
setTransitRadius
void setTransitRadius (TransitRadius)
Parameters:
Integer TransitRadius - The transit radius in meters.
setURL
void setURL (URL)
Sets the URL that is called when the user clicks on the location.
Parameters:
String URL - URL that is called when the user clicks on the location.
setZip
void setZip (Zip)
Sets the zip code of the location's address.
Parameters:
String Zip - The zip code.