template

a template function used for markers customization

function template;

Example

webix.ui({
  // provide your own Google API key
  key:"AIzaSyAi0oVNVO-e603aUY8SILdD4v9bVBkmiTg",
  // Map ID is required for advanced markers
  mapId:"DEMO_MAP_ID",
  view:"google-map",
  // making markers interactive
  template: function(item){
    const element = webix.html.create("div", {class:"user"}, 
    `<span class='webix_icon wxi-user'></span><span class='name'>${item.name}</span>`);
    element.onclick = function(){
      this.classList.toggle("active");
    };
    return element;
  }
});

Related samples

Details

The template function takes the following parameters:

  • item - (object) the item object
  • PinElement - (object) the PinElement object for customization of the default pin

and returns the HTML element.

See also
  • API
  • Articles
  • Back to top