L.mapquest.textMarker is used to display clickable/draggable icons with text and subtext on the map.
L.mapquest.textMarker([45, -120], {
text: 'Coffee Shop',
subtext: 'Iconic coffeehouse chain',
position: 'right',
type: 'marker',
icon: {
primaryColor: '#333333',
secondaryColor: '#333333',
size: 'sm'
}
}).addTo(map);
Text that appears next to the marker (no text by default).
Text that appears next to the marker below and with smaller font than the text (no subtext by default).
The position of the text and subtext relative to the marker. The available options are 'right', 'left', 'top', and 'bottom'.
A string that specifies the type of icon to be rendered. The available options are 'marker', 'via', and 'circle'.
An object containing any of the following key value options: primaryColor, secondaryColor, shadow, size, and symbol.
primaryColor: The string hex code primary color of the marker. Default is '#ffffff'.
secondaryColor: The string hex code secondary color of the marker. Default is '#333333'.
shadow: A boolean that determines if a shadow is rendered with the icon. Default is true.
size: The size of the marker as a string: 'sm', 'md', or 'lg'. Default is 'lg'.
symbol: The string symbol to be rendered inside the marker. Can be a single letter or up to three numbers between 0 and 999. Not available with 'via' markers.
Text for the browser tooltip that appear on marker hover (no tooltip by default).
Text for the alt attribute of the icon image (useful for accessibility).
Determines whether the marker is draggable with mouse/touch.
Returns the current geographical position of the marker in a LatLng object.
Changes the marker position to the given point. Returns this.
Changes the marker text and subtext. Returns this.
Changes the marker icon. Returns this.