Class: Image

ol.legend. Image

A class for legend image


new Image(options, url [, title] [, img] [, src] [, className] [, width])

Parameters:
Name Type Argument Description
options Object
url string
title string <optional>
img HTMLImageElement | HTMLCanvasElement <optional>

an image to display

src string <optional>

legend image url (if no img option)

className string <optional>

'center' to center the title

width number <optional>

legend width, default use the image width

Fires:
  • event:changed

Methods


getElement(size, onclick)

Get element

Parameters:
Name Type Description
size ol.size

symbol size

onclick function

getHeight()

Get image height

Returns:
Type
number

getImage()

Get Image

Returns:
Type
Image

getWidth()

Get image width

Returns:
Type
number

setTitle(title)

Set the legend title

Parameters:
Name Type Description
title string

setWidth( [width])

Set the item width

Parameters:
Name Type Argument Description
width number <optional>

legend width, default use the image width