Render Attributes for Selected Store

Render attributes of the selected stores with template rendering.
  1. Store Selection
  2. Render Store Attributes with Template

Store Selection

The TiledView has a bindable property that you can use: selectedStore. The TiledView handles the click event on all store markers and save the store clicked into this property. It automatically change the style of the marker if it was provided on the TiledView initialization.

        let selectedStoreObj = new woosmap.utils.MVCObject();
selectedStoreObj.selectedStore = null;
selectedStoreObj.selectedStore_changed = function() {
    const selectedStore = this.get('selectedStore');
selectedStoreObj.bindTo('selectedStore', mapView, 'selectedStore', false);


Render Store Attributes with Template

        <div id="main">
  <div id="my-map-container">
    <div id="my-map"></div>
  <div id="sidebar-container">
    <div id="sidebar">
      <section id="selected-store-container">

        const selectedStoreTemplate = "<div class='woosmap-tableview-cell'>" +
  "<div class='store-photo-header'></div>" +
  "<div class='selected-store-card'><div class='hero'>" +
  "<div class='store-title'>{{name}}</div>" +
  "{{#types}}<div class='store-types'>{{types}}</div>{{/types}}</div>" +
  "<div class='content'><div class='store-address'>{{address.lines}}</div>" +
  "{{}}<div class='store-contact'><a href='tel:{{}}'>{{}}</a></div>{{/}}" +
  "{{}}<div class='store-website'><a href='{{}}' target='_blank'>Go to website</a></div>{{/}}" +
  "</div></div>" +

function renderSelectedStore(store) {
  const templateRenderer = new woosmap.TemplateRenderer(selectedStoreTemplate);
  const selectedStoreHTML = templateRenderer.render(;
  const $selectedStoreContainer = woosmap.$('#selected-store-container');


Click on a store to see attributes displayed in the sidebar.