Articles and Tutorials

GSPointFeature

GSPointFeature represents a point of interest (POI) feature.

 

 
// 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 params = {
id: "12345",
coordinate: coord,
icon: icon,
name: "Nelson"};

var feature = new GSPointFeature(params);
 
layer.addFeature(feature);
Field Summary
 GSPoint coordinate
          The coordinate this point feature is centered on
 String district
          The district containing this point feature
 boolean draggable
          If true this point feature should be draggable.
 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
 boolean onmap
          Flag that is true if this feature has been added to a map instance
 String region
          The region containing this point feature
 String suburb
          The suburb containing this point feature
 
Constructor Summary
GSPointFeature (<Object> params)
            Creates a new GSPointFeature that is initialized with the properties specified in the params associative array.
 
Method Summary
 Object addEventHandler(<String> eventType, <Function> func)
           Calls the handler function provided when the given event is triggered on this feature
 void addListenerToken(<String> eventType, <String> listenerToken)
           Adds an event listener token to the internal map maintained by this point feature
 GSPointFeature clone()
           Creates a copy of this feature
 void openMapBlowup(<int> zoomLevel)
           Opens a blowup map centered on this feature.
 void removeEventHandler(<Object> token)
           Removes the event handler function represented by the token parameter from this feature
 void setIcon(<GSIcon> icon)
           Sets the icon used by this point feature
 void setVisible(<boolean> visible)
           Sets the visibility of this point feature
 void showInfoWindow(<String> html)
           Displays the specified HTML markup in the info window above this feature
 String toString()
           Outputs this features properties as a String

Field Detail

coordinate

GSPoint coordinate
    The coordinate this point feature is centered on

district

String district
    The district containing this point feature

draggable

boolean draggable
    If true this point feature should be draggable.

id

String id
    Unique id for this point feature

infoHtml

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

name

String name
    The name of this point feature

onmap

boolean onmap
    Flag that is true if this feature has been added to a map instance

region

String region
    The region containing this point feature

suburb

String suburb
    The suburb containing this point feature
Constructor Detail

GSPointFeature

GSPointFeature(<Object> params)
    Creates a new GSPointFeature that is initialized with the properties specified in the params associative array. 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.
  •  
    •  
      • id - a unique id for this point feature
      • coordinate - the coordinate this point feature is centered on
      • icon - an instance of GSIcon used to represent this feature visually on the map
      • name - the name of this point feature
      • suburb - the suburb containing this point feature
      • district - the district containing this point feature
      • region - the region containing this point feature
    • params - an associative array of named arguments used to initialize the point feature object, the following parameters may be specified:
  • Parameters:
Method Detail

addEventHandler

Object addEventHandler(<String> eventType, <Function> func)
    Calls the handler function provided when the given event is triggered on this feature
  •  
      eventType - the event that should trigger the handler function
      func - the function to be invoked when the event is triggered
  • Parameters:

addListenerToken

void addListenerToken(<String> eventType, <String> listenerToken)
    Adds an event listener token to the internal map maintained by this point feature
  •  
      eventType - the event listener type
      listenerToken - a key to the listener entry in the event cache
  • Parameters:

clone

GSPointFeature clone()
    Creates a copy of this feature
  •  
      a clone of this feature
  • Returns:

openMapBlowup

void openMapBlowup(<int> zoomLevel)
    Opens a blowup map centered on this feature.
  •  
      zoomLevel - an integer value from 0 (maximum zoom in) to 16 (maximum zoom out)
  • Parameters:

removeEventHandler

void removeEventHandler(<Object> token)
    Removes the event handler function represented by the token parameter from this feature
  •  
      token - a token identifying the event handler to be removed
  • Parameters:

setIcon

void setIcon(<GSIcon> icon)
    Sets the icon used by this point feature
  •  
      icon - the icon to set
  • Parameters:

setVisible

void setVisible(<boolean> visible)
    Sets the visibility of this point feature
  •  
      visible - true if this feature should be visible on the map
  • Parameters:

showInfoWindow

void showInfoWindow(<String> html)
    Displays the specified HTML markup in the info window above this feature
  •  
      html - the HTML markup to display in the info window. If not provided the value of this feature's infoHtml property will be usedi
  • Parameters:

toString

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