Planit.js

update ()

Class: Marker

This will update (change) the marker's attributes or appearance. It doesn't currently have API access to all of the marker's original options, but some can be changed. See below for your options.

Options

Option Value Default Description
color String NULL Sets the background color of the marker
infobox Text NULL Sets the HTML of the infobox if there is an infobox
draggable Boolean false Toggle whether the marker is draggable
coords Array as [xPc, yPc] position() Moves the marker to the given coordinates

Returns: true

Example

// assuming you already have access to `marker` as a Marker object
marker.update({
  color: '#dddddd'
});