namespace MapIconMaker

This namespace contains functions that you can use to easily create dynamically sized and colored icons.

Static Methods

Methods Return Value Description
createMarkerIcon(opts?) GIcon Creates an icon based on the specified options in the MarkerIconOptions argument.

class MarkerIconOptions

This class represents optional arguments to the createMarkerIcon constructor. It has no constructor, but is instantiated as object literal (e.g. {width: 44, height: 44}.

Properties

Properties Type Description
width Number Specifies, in pixels, the width of the icon. The width may include some blank space on the side, depending on the height of the icon, as the icon will scale its shape proportionately. If not specified, the width will default to 32.
height Number Specifies, in pixels, the height of the icon. If not specified, the height will default to 32.
primaryColor String Specifies, as a hexadecimal string, the color used for the majority of the icon body. If not specified, the primary color will default to "#ff0000."
cornerColor String Specifies, as a hexadecimal string, the color used for the top corner of the icon. If you'd like the icon to have a consistent color, make the cornerColor the same as the primaryColor. If not specified, the corner color will default to "#ffffff".
strokeColor String Specifies, as a hexadecimal string, the color used for the outside line (stroke) of the icon. If not specified, the stroke color will default to "#000000."