The icon represents a graphical icon on the screen. Typically used in conjunction with a OpenLayers.Marker to represent markers on a screen.
An icon has a url, size and position. It also contains an offset which allows the center point to be represented correctly. This can be provided either as a fixed offset or a function provided to calculate the desired offset.
| OpenLayers.Icon | The icon represents a graphical icon on the screen. |
| Properties | |
| url | {String} image url |
| size | {OpenLayers.Size} |
| offset | {OpenLayers.Pixel} distance in pixels to offset the image when being rendered |
| calculateOffset | {OpenLayers.Pixel} Function to calculate the offset (based on the size) |
| imageDiv | {DOMElement} |
| px | {OpenLayers.Pixel} |
| Constructor | |
| OpenLayers.Icon | Creates an icon, which is an image tag in a div. |
| Functions | |
| destroy | Nullify references and remove event listeners to prevent circular references and memory leaks |
| clone | {OpenLayers.Icon} A fresh copy of the icon. |
| setSize | |
| setUrl | |
| draw | Move the div to the given pixel. |
| setOpacity | Change the icon’s opacity |
| moveTo | move icon to passed in px. |
| display | Hide or show the icon |
{OpenLayers.Pixel} distance in pixels to offset the image when being rendered
{OpenLayers.Pixel} Function to calculate the offset (based on the size)
Creates an icon, which is an image tag in a div.
| url | {String} |
| size | {OpenLayers.Size} |
| offset | {OpenLayers.Pixel} |
| calculateOffset | {Function} |
draw: function( px )
Move the div to the given pixel.
| px | {OpenLayers.Pixel} |
{DOMElement} A new DOM Image of this icon set at the location passed-in
Nullify references and remove event listeners to prevent circular references and memory leaks
destroy: function()
{OpenLayers.Icon} A fresh copy of the icon.
clone: function()
setSize: function( size )
setUrl: function( url )
Move the div to the given pixel.
draw: function( px )
Change the icon’s opacity
setOpacity: function( opacity )
move icon to passed in px.
moveTo: function ( px )
Hide or show the icon
display: function( display )