A method to update a marker configuration in a map location.
Parameter |
Value |
---|---|
titleConfig (optional): |
Title configuration. |
text: string |
Text of marker. |
fgColor: string |
Foreground color of marker text. |
bgColor: string |
Background color of marker text. |
css: url (to css file) |
Cascading style sheet of marker text. Can be used to format the title, add bold, increase font size etc. |
border: string |
Border of marker text. |
padding: string |
Padding of marker text. |
imgConfig (Optional) |
Image configuration. |
url (to image file) |
Image of marker. |
bgColor: string |
Background color of marker image. |
offset: a point set |
Point locations { x: <x>, y: <y>} in pixels from the center point of the marker the image should be moved to. This is useful so that the image doesn't appear directly inside the center point. |
css: url (to css file) |
Cascading style sheet of marker image. Can be used to format the title, add bold, increase font size etc. |
border: string |
Border of marker image. |
padding: string |
Padding of marker image. |
markerConfig |
Marker configuration. |
bgColor: string |
Background color of marker. |
css: url (to css file) |
Cascading style sheet of marker. Can be used to format the title, add bold, increase font size etc. |
border: string |
Border of marker. |
padding: string |
Padding of marker. |
updateAll: boolean (default=false) |
Update all parameter values or merge with current parameter values. |
Example:
marker.update( { text: "Company" } );
Or
var newTitleConfig = { padding: "10px", border: "12px", text: "Update example", fgColor: "green", bgColor: "yellow", css: "" };
var newImgConfig = { padding: "1px", url: "http://kort.samsyn.is/api/img/key.png",
offset: { x: 10, y: 12 }, bgColor: "red", border: "1px", css: "" };
var newMarkerConfig = { bgColor: "orange", border: "2px", padding: "2px", display: "block", css: "" };
marker.update(newTitleConfig, newImgConfig, newMarkerConfig);