UNPKG

@mint-ui/map

Version:

- React map library - Control various map with one interface - Google, Naver, Kakao map supported now - Typescript supported - Canvas marker supported

59 lines (45 loc) 1.2 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var MintMapStatus = /** @class */ function () { function MintMapStatus() { this.marker = 0; this.byLabel = new Map(); } MintMapStatus.prototype.init = function () { this.marker = 0; this.byLabel.clear(); }; MintMapStatus.prototype.print = function () { var str = "[mint-map status]\n\nmarker : ".concat(this.marker, "\n "); if (this.byLabel.size > 0) { str += '\n-------- status detail (by label) ----------'; this.byLabel.forEach(function (val, key) { str += "\n(".concat(key, ") : ").concat(val); }); str += '\n\n'; } console.log(str); }; MintMapStatus.prototype.setMarker = function (inc, label) { this.marker += inc; if (label) { var curr = this.byLabel.get(label); var calc = 0; if (curr === undefined) { calc = inc; } else { calc = curr + inc; } if (calc === 0) { this.byLabel.delete(label); } else { this.byLabel.set(label, calc); } } }; return MintMapStatus; }(); var Status = new MintMapStatus(); exports.Status = Status;