Class: IWIcon

IWIcon

A class representing an icon which can be placed on the map in an overlay (e.g. IWMarker). The icon is defined by an URL, hotspot and size.

The hotspot defines a pixel position in the icon (relative to the upper left corner) which is placed at the coordinate of the overlay. When using a circle with a symbol in the center, the hotspot should be the center of the icon. If you use a symbol like a pushpin instead, the hotspot should point to the needle of the pushpin.


new IWIcon(url, hotspot, size)

Creates a new icon.
Parameters:
Name Type Description
url String an absolute URL to the image
hotspot IWPoint the hotspot (optional, defaults to 0,0)
size IWSize the size of the image in pixels

Methods


getHotspot()

Returns the hotspot of the image.
Returns:
Type
IWPoint

getSize()

Returns the size of the image in pixel.
Returns:
Type
IWSize

getUrl()

Returns the URL of the image.
Returns:
Type
String

setHotspot(hotspot)

Sets the hotspot of the image.
Parameters:
Name Type Description
hotspot IWPoint
Returns:
Type
void

setSize(size)

Sets the size of the image in pixel.
Parameters:
Name Type Description
size IWSize the size of the image in pixel
Returns:
Type
void

setUrl(url)

Sets the URL of the image.
Parameters:
Name Type Description
url String an absolute URL to the image
Returns:
Type
void

toString()

Returns a string representation of this icon.
Returns:
Type
String