JSFiddle - React, Tailwind, and code Playground

by eddiriarte

Babel + JSX

const DEFAULT_OPTIONS = {};

class PartnerCityMap {

  /**
   *
   * @param {HTMLElement} canvas
   * @param {Array<Object>} cities
   * @param {Object|LatLong} center
   * @param {Object} options
   */
  constructor(canvas, cities, center, options = {}) {
    this.canvas = canvas;
    this.cities = cities;
    this.center = center;
    this.options = Object.assign(DEFAULT_OPTIONS, options);
  }
  
  init() {
  	this.map = new google.maps.Map(this.canvas, this.options);
  }
  
  get smallIcon() {
  	return {
      anchor: new google.maps.Point(12, 12),
      url: 'https://www.goethe.de/skripte/projekte/freiraum/img/map_marker_small.png'
    };
  }
  
  get largeIcon() {
  	return {
      anchor: new google.maps.Point(12, 12),
      url: 'https://www.goethe.de/skripte/projekte/freiraum/img/map_marker_small.png'
    };
  }
}