Class GSPointFeature

Extends GSMapFeature.

GSPointFeature represents a point of interest (POI) feature.

Class Summary
Constructor Attributes Constructor Name and Description
 
GSPointFeature(options)
Creates a new GSPointFeature that is initialized with the properties specified in the options hash.
Property Summary
Property Attributes Property Name and Description
 
The coordinate this point feature is centered on
 
id
Unique id for this point feature
 
HTML markup to display in this feature's info window.
 
The name of this point feature
Method Summary
Method Attributes Method Name and Description
 
Creates a copy of this feature
 
Gets the minimum bounding box necessary to contain this map feature
 
Return the icon for the point feature
 
Returns a boolean value indicating if this point feature is draggable
 
Returns a boolean value indicating the visibility of this point feature
 
openMapBlowup(zoomLevel)
Opens a blowup map centered on this feature.
 
Removes a badge from the point feature if set
 
setBadge(count, options)
Sets a badge for the point feature
 
setCoordinate(coordinate)
Sets the coordinate for this point feature
 
setIcon(icon)
Sets the icon used by this point feature
 
setImage(url)
Sets the foreground image for the feature's icon.
 
setLabel(label)
Sets a label for this point feature
 
setName(name)
Set the name of the point feature
 
setVisible(visible)
Sets the visibility of this point feature
 
setZIndex(zIndex)
Sets the z-index property of this point feature
 
Returns a GeoJSON representation of this feature
 
Outputs a GML representation of this map feature.
 
Outputs a JSON representation of this map feature
 
Outputs this features properties as a String
 
Outputs a Well-Known Text (WKT) representation of this map feature.
Methods borrowed from class GSMapFeature:
addContextMenuItem, addEventHandler, addEventListener, addListener, deleteProperty, deselect, disableContextMenu, enableContextMenu, getContextMenu, getProperties, getProperty, isSelectable, removeContextMenu, removeContextMenuItem, removeEventHandler, removeEventListener, removeEventListeners, removeListener, select, setContextMenu, setProperty, setTip, showInfoWindow
Event Summary
Event Attributes Event Name and Description
 
featureDrag(feature)
 
featureDragEnd(feature)
 
 
 
Events borrowed from class GSMapFeature:
featureClicked, featureRemoved
Class Detail
GSPointFeature(options)
Creates a new GSPointFeature that is initialized with the properties specified in the options hash. Of these properties the icon property must be specified if a custom icon is to be used, otherwise the point feature will default to using the default SmartFIND icon type.
// create the feature's icon
var icon = new GSIcon();
icon.imageSrc = "http://www.example.com/images/icon.png";
icon.imageSize = new GSDimension(22, 16);

// create the coordinate the feature will be centered on
var coord = new GSPoint(2530000, 5990000);

var options = {
  id: "12345",
  coordinate: coord,
  icon: icon,
  name: "Nelson"};
  
var feature = new GSPointFeature(options);

layer.addFeature(feature);
Parameters:
{Object} options Optional
optional parameters to specify for this feature:
{int} options.id
a unique id for this point feature
{GSPoint} options.coordinate
the coordinate this point feature is centered on
{GSIcon} options.icon
an instance of GSIcon used to represent this feature visually on the map
{String} options.name
the name of this point feature
Property Detail
{GSPoint} coordinate
The coordinate this point feature is centered on

{String} id
Unique id for this point feature

{String} infoHtml
HTML markup to display in this feature's info window.

{String} name
The name of this point feature
Method Detail
{GSPointFeature} clone()
Creates a copy of this feature
Returns:
{GSPointFeature} a clone of this feature

{GSBounds} getBounds()
Gets the minimum bounding box necessary to contain this map feature
Returns:
{GSBounds} the bounds of this map feature

{GSIcon} getIcon()
Return the icon for the point feature
Returns:
{GSIcon} the feature's icon

{boolean} isDraggable()
Returns a boolean value indicating if this point feature is draggable
Returns:
{boolean} true if this point feature is draggable

{boolean} isVisible()
Returns a boolean value indicating the visibility of this point feature
Returns:
{boolean} true if this point feature is currently visible on the map

openMapBlowup(zoomLevel)
Opens a blowup map centered on this feature.
Parameters:
{int} zoomLevel
an integer value from 0 (maximum zoom out) to 16 (maximum zoom in)

removeBadge()
Removes a badge from the point feature if set

{GSBadge} setBadge(count, options)
Sets a badge for the point feature
Parameters:
{int} count
the count to display in the badge
{Object} options Optional
an object literal specifying the badge options to set:
{String} options.color
the color to use for the badge background. This can be one of 'red', 'green', 'blue' (default)
{int} options.offsetTop
the distance in pixels that the bottom edge of the badge should be offset from top of the feature icon, defaults to -15
{int} options.offsetRight
the distance in pixels that the left edge of the badge should be offset from the right of the feature icon, defaults to -10
{String} options.cursor
the cursor type to use for the badge
Throws:
{Error}
if the badge module has not been loaded
Returns:
{GSBadge} the badge instance set on this feature

setCoordinate(coordinate)
Sets the coordinate for this point feature
Parameters:
{GSPoint} coordinate
the coordinate to position the feature at

setIcon(icon)
Sets the icon used by this point feature
Parameters:
{GSIcon} icon
the icon to set

setImage(url)
Sets the foreground image for the feature's icon. Neither the image size or the shadow image for the icon is effected by this method. If a more complete change to the feature's icon is required use GSPointFeature.setIcon() instead.
Parameters:
{String} url
the url of the image to use for the icon foreground

setLabel(label)
Sets a label for this point feature
Parameters:
{GSLabel} label
the label to set

setName(name)
Set the name of the point feature
Parameters:
{String} name
new name for text icons

setVisible(visible)
Sets the visibility of this point feature
Parameters:
{boolean} visible
true if this feature should be visible on the map

setZIndex(zIndex)
Sets the z-index property of this point feature
Parameters:
{int} zIndex
the zIndex to use for this feature

{Object} toGeoJsonObj()
Returns a GeoJSON representation of this feature
Returns:
{Object} a GeoJSON object

{String} toGML()
Outputs a GML representation of this map feature. Output is a GML 2.x string.
Returns:
{String} a GML string

{String} toJson()
Outputs a JSON representation of this map feature
Returns:
{String} a JSON string

{String} toString()
Outputs this features properties as a String
Returns:
{String} this features properties as a String

{String} toWKT()
Outputs a Well-Known Text (WKT) representation of this map feature.
Returns:
{String} a WKT string
Event Detail
featureDrag(feature)
Parameters:
{GSMapFeature} feature
the feature that was dragged

featureDragEnd(feature)
Parameters:
{GSMapFeature} feature
the feature that was dragged

featureDragStart(feature)
Parameters:
{GSMapFeature} feature
the feature that was dragged

featureNotVisibleOnMap(feature)
Parameters:
{GSMapFeature} feature
the feature that has become not visible

featureVisibleOnMap(feature)
Parameters:
{GSMapFeature} feature
the feature that has become visible

Documentation generated by JsDoc Toolkit 2.3.2 on Wed Mar 07 2012 11:47:29 GMT+1300 (NZDT)