From d7316ce4af1a6a23440ea7f31a1c37937cbf250c Mon Sep 17 00:00:00 2001 From: Zhenyang Hua Date: Mon, 19 Mar 2018 08:21:15 -0400 Subject: [PATCH] Updated MeasureResult in measure_end listener --- CHANGES.md | 8 ++ README.md | 4 +- lib/MeasureTool.js | 294 ++++++++++++++++++++--------------------- lib/MeasureTool.min.js | 2 +- package.json | 2 +- src/index.js | 6 +- 6 files changed, 161 insertions(+), 155 deletions(-) create mode 100644 CHANGES.md diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..3a9ff93 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,8 @@ +# Changes +## v0.1.1 +*Released on 03/19/2018* +- **[Bug Fix]** Updated `MeasureResult` in `measure_end` listener. + +## v0.1.0 +*Released on 03/18/2018* +- **[New Feature]** Added `Array` to the `MeasureResult`. Example see [#31](https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3/issues/31). \ No newline at end of file diff --git a/README.md b/README.md index 915262d..7b15983 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,7 @@ A handy measurement widget for Google Maps API v3. The functionalities are imple ![demo screen shot](https://raw.githubusercontent.com/zhenyanghua/MeasureTool-GoogleMaps-V3/master/demo.jpg) ## Changes -### v0.1.0 -*Released on 03/18/2018* -- **[New Feature]** Added `Array` to the `MeasureResult`. Example see [#31](https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3/issues/31). +[Change List](https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3/blob/master/CHANGES.md) ## Developer usage #### Dependency diff --git a/lib/MeasureTool.js b/lib/MeasureTool.js index 0b1ba22..0fc4a72 100644 --- a/lib/MeasureTool.js +++ b/lib/MeasureTool.js @@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 73); +/******/ return __webpack_require__(__webpack_require__.s = 74); /******/ }) /************************************************************************/ /******/ ([ @@ -81,35 +81,35 @@ return /******/ (function(modules) { // webpackBootstrap /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__select__ = __webpack_require__(63); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__selectAll__ = __webpack_require__(64); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter__ = __webpack_require__(52); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__data__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__select__ = __webpack_require__(64); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__selectAll__ = __webpack_require__(65); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter__ = __webpack_require__(53); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__data__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__enter__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__exit__ = __webpack_require__(51); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__merge__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__order__ = __webpack_require__(59); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__sort__ = __webpack_require__(66); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__call__ = __webpack_require__(44); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__nodes__ = __webpack_require__(58); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__node__ = __webpack_require__(57); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__size__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__empty__ = __webpack_require__(50); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__each__ = __webpack_require__(49); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__attr__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__style__ = __webpack_require__(67); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__property__ = __webpack_require__(60); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__classed__ = __webpack_require__(45); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__text__ = __webpack_require__(68); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__html__ = __webpack_require__(53); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__raise__ = __webpack_require__(61); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__lower__ = __webpack_require__(55); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__append__ = __webpack_require__(42); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__insert__ = __webpack_require__(54); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__remove__ = __webpack_require__(62); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__datum__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__exit__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__merge__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__order__ = __webpack_require__(60); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__sort__ = __webpack_require__(67); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__call__ = __webpack_require__(45); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__nodes__ = __webpack_require__(59); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__node__ = __webpack_require__(58); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__size__ = __webpack_require__(66); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__empty__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__each__ = __webpack_require__(50); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__attr__ = __webpack_require__(44); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__style__ = __webpack_require__(68); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__property__ = __webpack_require__(61); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__classed__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__text__ = __webpack_require__(69); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__html__ = __webpack_require__(54); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__raise__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__lower__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__append__ = __webpack_require__(43); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__insert__ = __webpack_require__(55); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__remove__ = __webpack_require__(63); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__datum__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__on__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__dispatch__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__dispatch__ = __webpack_require__(49); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return root; }); /* harmony export (immutable) */ __webpack_exports__["b"] = Selection; @@ -197,19 +197,19 @@ Selection.prototype = selection.prototype = { Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_creator__ = __webpack_require__(4); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "creator", function() { return __WEBPACK_IMPORTED_MODULE_0__src_creator__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_local__ = __webpack_require__(38); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_local__ = __webpack_require__(39); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "local", function() { return __WEBPACK_IMPORTED_MODULE_1__src_local__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_matcher__ = __webpack_require__(16); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_2__src_matcher__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__src_mouse__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__src_mouse__ = __webpack_require__(40); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mouse", function() { return __WEBPACK_IMPORTED_MODULE_3__src_mouse__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__src_namespace__ = __webpack_require__(5); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "namespace", function() { return __WEBPACK_IMPORTED_MODULE_4__src_namespace__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__src_namespaces__ = __webpack_require__(6); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "namespaces", function() { return __WEBPACK_IMPORTED_MODULE_5__src_namespaces__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__src_select__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__src_select__ = __webpack_require__(41); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_6__src_select__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__src_selectAll__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__src_selectAll__ = __webpack_require__(42); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "selectAll", function() { return __WEBPACK_IMPORTED_MODULE_7__src_selectAll__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__src_selection_index__ = __webpack_require__(0); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "selection", function() { return __WEBPACK_IMPORTED_MODULE_8__src_selection_index__["a"]; }); @@ -217,9 +217,9 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "selector", function() { return __WEBPACK_IMPORTED_MODULE_9__src_selector__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__src_selectorAll__ = __webpack_require__(19); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "selectorAll", function() { return __WEBPACK_IMPORTED_MODULE_10__src_selectorAll__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__src_touch__ = __webpack_require__(69); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__src_touch__ = __webpack_require__(70); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "touch", function() { return __WEBPACK_IMPORTED_MODULE_11__src_touch__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__src_touches__ = __webpack_require__(70); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__src_touches__ = __webpack_require__(71); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "touches", function() { return __WEBPACK_IMPORTED_MODULE_12__src_touches__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__src_window__ = __webpack_require__(11); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return __WEBPACK_IMPORTED_MODULE_13__src_window__["a"]; }); @@ -984,7 +984,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _config = __webpack_require__(2); -var _contextMenu = __webpack_require__(71); +var _contextMenu = __webpack_require__(72); var _contextMenu2 = _interopRequireDefault(_contextMenu); @@ -1524,6 +1524,54 @@ module.exports = exports["default"]; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Segment = exports.Segment = function () { + function Segment(start, end, length, lengthText) { + _classCallCheck(this, Segment); + + this._start = start; + this._end = end; + this._length = length; + this._lengthText = lengthText; + } + + _createClass(Segment, [{ + key: "toJSON", + value: function toJSON() { + return { + "start_location": { + "lat": this._start[1], + "lng": this._start[0] + }, + "end_location": { + "lat": this._end[1], + "lng": this._end[0] + }, + "length": { + "text": this._lengthText, + "value": this._length + } + }; + } + }]); + + return Segment; +}(); + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -1532,7 +1580,7 @@ var _createClass = function () { function defineProperties(target, props) { for var _config = __webpack_require__(2); -var _tooltip = __webpack_require__(72); +var _tooltip = __webpack_require__(73); var _tooltip2 = _interopRequireDefault(_tooltip); @@ -1576,12 +1624,12 @@ exports.default = Tooltip; module.exports = exports['default']; /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_drag__ = __webpack_require__(35); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_drag__ = __webpack_require__(36); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return __WEBPACK_IMPORTED_MODULE_0__src_drag__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_nodrag__ = __webpack_require__(14); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "dragDisable", function() { return __WEBPACK_IMPORTED_MODULE_1__src_nodrag__["a"]; }); @@ -1591,13 +1639,13 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a