From 3dcccf0f30adda9ba0a96b3cffa52b162bc656f7 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:01:42 +0100 Subject: [PATCH 01/11] Deleted npm-debug.log. --- npm-debug.log | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 8f75acc..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/Users/hiasinho/.nvm/versions/node/v5.5.0/bin/node', -1 verbose cli '/Users/hiasinho/.nvm/versions/node/v5.5.0/bin/npm', -1 verbose cli 'version', -1 verbose cli 'minor' ] -2 info using npm@3.3.12 -3 info using node@v5.5.0 -4 info git [ 'status', '--porcelain' ] -5 verbose stack Error: Git working directory not clean. -5 verbose stack M LICENSE -5 verbose stack M README.md -5 verbose stack M bower.json -5 verbose stack M dist/leaflet-vector-markers.css -5 verbose stack M dist/leaflet-vector-markers.js -5 verbose stack M dist/leaflet-vector-markers.min.js -5 verbose stack M lib/Icon.js -5 verbose stack M src/Icon.js -5 verbose stack M src/leaflet-vector-markers.scss -5 verbose stack at /Users/hiasinho/.nvm/versions/node/v5.5.0/lib/node_modules/npm/lib/version.js:172:21 -5 verbose stack at ChildProcess.exithandler (child_process.js:204:7) -5 verbose stack at emitTwo (events.js:100:13) -5 verbose stack at ChildProcess.emit (events.js:185:7) -5 verbose stack at maybeClose (internal/child_process.js:821:16) -5 verbose stack at Socket. (internal/child_process.js:319:11) -5 verbose stack at emitOne (events.js:90:13) -5 verbose stack at Socket.emit (events.js:182:7) -5 verbose stack at Pipe._onclose (net.js:469:12) -6 verbose cwd /Volumes/Data/hiasinho/Sites/Leaflet.vector-markers -7 error Darwin 15.3.0 -8 error argv "/Users/hiasinho/.nvm/versions/node/v5.5.0/bin/node" "/Users/hiasinho/.nvm/versions/node/v5.5.0/bin/npm" "version" "minor" -9 error node v5.5.0 -10 error npm v3.3.12 -11 error Git working directory not clean. -11 error M LICENSE -11 error M README.md -11 error M bower.json -11 error M dist/leaflet-vector-markers.css -11 error M dist/leaflet-vector-markers.js -11 error M dist/leaflet-vector-markers.min.js -11 error M lib/Icon.js -11 error M src/Icon.js -11 error M src/leaflet-vector-markers.scss -12 error If you need help, you may report this error at: -12 error -13 verbose exit [ 1, true ] From 93311362e54a83dd201f3e3a4652ea4868e850c4 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:02:04 +0100 Subject: [PATCH 02/11] Added npm-debug.log to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e35a46e..703ce36 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ src/_lib node_modules bower_components coverage +npm-debug.log From 06a3d669aeef9935763308f597087660a9c9a17c Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:04:08 +0100 Subject: [PATCH 03/11] Added rimraf devDependency and changed the clean:lib script to use rimraf. This allows the script to run on Windows. --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2bf51aa..e43240c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/hiasinho/Leaflet.vector-markers.git" }, "scripts": { - "clean:lib": "rm -Rf ./lib", + "clean:lib": "rimraf ./lib", "compile:lib": "babel src --out-dir lib", "build:lib": "npm run clean:lib && npm run compile:lib", "build:dist": "webpack src/index.js dist/leaflet-vector-markers.js && webpack -p src/index.js dist/leaflet-vector-markers.min.js && webpack src/leaflet-vector-markers.scss dist/leaflet-vector-markers.css", @@ -46,6 +46,7 @@ "jest-cli": "^12.1.1", "node-sass": "^3.7.0", "onchange": "^2.4.0", + "rimraf": "^2.6.1", "sass-loader": "^3.2.0", "style-loader": "^0.13.1", "webpack": "^1.13.1", @@ -79,4 +80,4 @@ "/src/VectorMarkers" ] } -} +} \ No newline at end of file From 6e9ed62f9530657e5d1db5c10226ed199e92beda Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:28:50 +0100 Subject: [PATCH 04/11] Formatting. --- src/Icon.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Icon.js b/src/Icon.js index f03dd02..08ce6fe 100644 --- a/src/Icon.js +++ b/src/Icon.js @@ -1,11 +1,11 @@ import Leaflet from 'leaflet' const iconOptions = { - iconSize: [ 30, 50 ], - iconAnchor: [ 15, 50 ], - popupAnchor: [ 2, -40 ], - shadowAnchor: [ 39, 45 ], - shadowSize: [ 54, 51 ], + iconSize: [30, 50], + iconAnchor: [15, 50], + popupAnchor: [2, -40], + shadowAnchor: [39, 45], + shadowSize: [54, 51], className: 'vector-marker', prefix: 'fa', spinClass: 'fa-spin', From 66d9a360c2379f177d6aae536a642d2edfca5e30 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:32:03 +0100 Subject: [PATCH 05/11] Deleted dist and lib folders. --- dist/leaflet-vector-markers.css | 54 ------ dist/leaflet-vector-markers.js | 262 ----------------------------- dist/leaflet-vector-markers.min.js | 1 - lib/Icon.js | 138 --------------- lib/VectorMarkers.js | 21 --- lib/index.js | 26 --- 6 files changed, 502 deletions(-) delete mode 100644 dist/leaflet-vector-markers.css delete mode 100644 dist/leaflet-vector-markers.js delete mode 100644 dist/leaflet-vector-markers.min.js delete mode 100644 lib/Icon.js delete mode 100644 lib/VectorMarkers.js delete mode 100644 lib/index.js diff --git a/dist/leaflet-vector-markers.css b/dist/leaflet-vector-markers.css deleted file mode 100644 index 8c1b857..0000000 --- a/dist/leaflet-vector-markers.css +++ /dev/null @@ -1,54 +0,0 @@ -/* -Author: Mathias Schneider -License: MIT -Version: 0.0.6 -*/ -/* Marker setup */ -.vector-marker { - width: 35px; - height: 46px; - position: absolute; - left: 0; - top: 0; - display: block; - text-align: center; } - .vector-marker path { - stroke: black; - stroke-opacity: 0.4; - stroke-width: 1; } - .vector-marker.not-accepted { - opacity: 0.5; } - -.vector-marker-shadow:before { - bottom: -13px; - box-shadow: 35px -10px 10px rgba(0, 0, 0, 0.4); - content: ""; - height: 40%; - position: absolute; - right: 21px; - -webkit-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - transform-origin: 50% 50%; - -webkit-transform: skew(150deg) rotate(-40deg); - -ms-transform: skew(150deg) rotate(-40deg); - transform: skew(150deg) rotate(-40deg); - width: 60%; - z-index: -1; } - -.vector-marker i { - position: absolute; - top: 8px; - left: 0; - width: 32px; - color: #333; - margin: auto; - display: inline-block; - font-size: 14px; } - -.vector-marker i.maki-icon { - width: 24px; - left: 4px; - top: 4px; } - -.vector-marker .icon-white { - color: #fff; } diff --git a/dist/leaflet-vector-markers.js b/dist/leaflet-vector-markers.js deleted file mode 100644 index 9026e44..0000000 --- a/dist/leaflet-vector-markers.js +++ /dev/null @@ -1,262 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("leaflet")); - else if(typeof define === 'function' && define.amd) - define(["leaflet"], factory); - else if(typeof exports === 'object') - exports["VectorMarkers"] = factory(require("leaflet")); - else - root["VectorMarkers"] = factory(root["L"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.Icon = exports.VectorMarkers = undefined; - - var _leaflet = __webpack_require__(1); - - var _leaflet2 = _interopRequireDefault(_leaflet); - - var _VectorMarkers2 = __webpack_require__(2); - - var _VectorMarkers3 = _interopRequireDefault(_VectorMarkers2); - - var _Icon2 = __webpack_require__(3); - - var _Icon3 = _interopRequireDefault(_Icon2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.VectorMarkers = _VectorMarkers3.default; - exports.Icon = _Icon3.default; - - - _leaflet2.default.VectorMarkers = _VectorMarkers3.default; - -/***/ }, -/* 1 */ -/***/ function(module, exports) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_1__; - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _Icon = __webpack_require__(3); - - var _Icon2 = _interopRequireDefault(_Icon); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = { - version: '1.0.0', - - Icon: _Icon2.default, - - icon: function icon(options) { - return new _Icon2.default(options); - } - }; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - '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; }; }(); - - var _leaflet = __webpack_require__(1); - - var _leaflet2 = _interopRequireDefault(_leaflet); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var iconOptions = { - iconSize: [30, 50], - iconAnchor: [15, 50], - popupAnchor: [2, -40], - shadowAnchor: [39, 45], - shadowSize: [54, 51], - className: 'vector-marker', - prefix: 'fa', - spinClass: 'fa-spin', - extraIconClasses: '', - extraDivClasses: '', - icon: 'home', - markerColor: 'blue', - iconColor: 'white', - viewBox: '0 0 32 52' - }; - - var mapPin = 'M16,1 C7.7146,1 1,7.65636364 1,15.8648485 C1,24.0760606 16,51 16,51 C16,51 31,24.0760606 31,15.8648485 C31,7.65636364 24.2815,1 16,1 L16,1 Z'; - - var Icon = function (_Leaflet$Icon) { - _inherits(Icon, _Leaflet$Icon); - - function Icon(options) { - _classCallCheck(this, Icon); - - var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); - - _leaflet2.default.Util.setOptions(_this, iconOptions); - _leaflet2.default.Util.setOptions(_this, options); - return _this; - } - - _createClass(Icon, [{ - key: 'createIcon', - value: function createIcon(oldIcon) { - var div = oldIcon && oldIcon.tagName === 'DIV' ? oldIcon : document.createElement('div'); - var options = this.options; - var pin_path = options.map_pin || mapPin; - - div.innerHTML = ''; - - if (options.icon) { - div.appendChild(this._createInner()); - } - - options.className += options.className.length > 0 ? ' ' + options.extraDivClasses : options.extraDivClasses; - this._setIconStyles(div, 'icon'); - this._setIconStyles(div, 'icon-' + options.markerColor); - return div; - } - }, { - key: 'createShadow', - value: function createShadow() { - var div = document.createElement('div'); - this._setIconStyles(div, 'shadow'); - return div; - } - }, { - key: '_createInner', - value: function _createInner() { - var i = document.createElement('i'); - var options = this.options; - - i.classList.add(options.prefix); - if (options.extraClasses) { - i.classList.add(options.extraClasses); - } - if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') { - i.classList.add(options.icon); - } else { - i.classList.add(options.prefix + '-' + options.icon); - } - if (options.spin && typeof options.spinClass === 'string') { - i.classList.add(options.spinClass); - } - if (options.iconColor) { - if (options.iconColor === 'white' || options.iconColor === 'black') { - i.classList.add('icon-' + options.iconColor); - } else { - i.style.color = options.iconColor; - } - } - if (options.iconSize) { - i.style.width = options.iconSize[0] + 'px'; - } - return i; - } - }, { - key: '_setIconStyles', - value: function _setIconStyles(img, name) { - var options = this.options; - var size = _leaflet2.default.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']); - var anchor = void 0; - - if (name === 'shadow') { - anchor = _leaflet2.default.point(options.shadowAnchor || options.iconAnchor); - } else { - anchor = _leaflet2.default.point(options.iconAnchor); - } - if (!anchor && size) { - anchor = size.divideBy(2, true); - } - img.className = 'vector-marker-' + name + ' ' + options.className; - if (anchor) { - img.style.marginLeft = -anchor.x + 'px'; - img.style.marginTop = -anchor.y + 'px'; - } - if (size) { - img.style.width = size.x + 'px'; - img.style.height = size.y + 'px'; - } - } - }]); - - return Icon; - }(_leaflet2.default.Icon); - - exports.default = Icon; - -/***/ } -/******/ ]) -}); -; \ No newline at end of file diff --git a/dist/leaflet-vector-markers.min.js b/dist/leaflet-vector-markers.min.js deleted file mode 100644 index c76e82f..0000000 --- a/dist/leaflet-vector-markers.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports?exports.VectorMarkers=t(require("leaflet")):e.VectorMarkers=t(e.L)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=t.VectorMarkers=void 0;var r=o(2),i=n(r),s=o(3),a=n(s),c=o(1),l=n(c);t.VectorMarkers=a["default"],t.Icon=l["default"],i["default"].VectorMarkers=a["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var o=0;o',o.icon&&t.appendChild(this._createInner()),o.className+=o.className.length>0?" "+o.extraDivClasses:o.extraDivClasses,this._setIconStyles(t,"icon"),this._setIconStyles(t,"icon-"+o.markerColor),t}},{key:"createShadow",value:function(){var e=document.createElement("div");return this._setIconStyles(e,"shadow"),e}},{key:"_createInner",value:function(){var e=document.createElement("i"),t=this.options;return e.classList.add(t.prefix),t.extraClasses&&e.classList.add(t.extraClasses),t.icon.slice(0,t.prefix.length+1)===t.prefix+"-"?e.classList.add(t.icon):e.classList.add(t.prefix+"-"+t.icon),t.spin&&"string"==typeof t.spinClass&&e.classList.add(t.spinClass),t.iconColor&&("white"===t.iconColor||"black"===t.iconColor?e.classList.add("icon-"+t.iconColor):e.style.color=t.iconColor),t.iconSize&&(e.style.width=t.iconSize[0]+"px"),e}},{key:"_setIconStyles",value:function(e,t){var o=this.options,n=l["default"].point(o["shadow"===t?"shadowSize":"iconSize"]),r=void 0;r="shadow"===t?l["default"].point(o.shadowAnchor||o.iconAnchor):l["default"].point(o.iconAnchor),!r&&n&&(r=n.divideBy(2,!0)),e.className="vector-marker-"+t+" "+o.className,r&&(e.style.marginLeft=-r.x+"px",e.style.marginTop=-r.y+"px"),n&&(e.style.width=n.x+"px",e.style.height=n.y+"px")}}]),t}(l["default"].Icon);t["default"]=p},function(t,o){t.exports=e},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(1),i=n(r);t["default"]={version:"1.0.0",Icon:i["default"],icon:function(e){return new i["default"](e)}}}])}); \ No newline at end of file diff --git a/lib/Icon.js b/lib/Icon.js deleted file mode 100644 index bee7160..0000000 --- a/lib/Icon.js +++ /dev/null @@ -1,138 +0,0 @@ -'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; }; }(); - -var _leaflet = require('leaflet'); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var iconOptions = { - iconSize: [30, 50], - iconAnchor: [15, 50], - popupAnchor: [2, -40], - shadowAnchor: [39, 45], - shadowSize: [54, 51], - className: 'vector-marker', - prefix: 'fa', - spinClass: 'fa-spin', - extraIconClasses: '', - extraDivClasses: '', - icon: 'home', - markerColor: 'blue', - iconColor: 'white', - viewBox: '0 0 32 52' -}; - -var mapPin = 'M16,1 C7.7146,1 1,7.65636364 1,15.8648485 C1,24.0760606 16,51 16,51 C16,51 31,24.0760606 31,15.8648485 C31,7.65636364 24.2815,1 16,1 L16,1 Z'; - -var Icon = function (_Leaflet$Icon) { - _inherits(Icon, _Leaflet$Icon); - - function Icon(options) { - _classCallCheck(this, Icon); - - var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); - - _leaflet2.default.Util.setOptions(_this, iconOptions); - _leaflet2.default.Util.setOptions(_this, options); - return _this; - } - - _createClass(Icon, [{ - key: 'createIcon', - value: function createIcon(oldIcon) { - var div = oldIcon && oldIcon.tagName === 'DIV' ? oldIcon : document.createElement('div'); - var options = this.options; - var pin_path = options.map_pin || mapPin; - - div.innerHTML = ''; - - if (options.icon) { - div.appendChild(this._createInner()); - } - - options.className += options.className.length > 0 ? ' ' + options.extraDivClasses : options.extraDivClasses; - this._setIconStyles(div, 'icon'); - this._setIconStyles(div, 'icon-' + options.markerColor); - return div; - } - }, { - key: 'createShadow', - value: function createShadow() { - var div = document.createElement('div'); - this._setIconStyles(div, 'shadow'); - return div; - } - }, { - key: '_createInner', - value: function _createInner() { - var i = document.createElement('i'); - var options = this.options; - - i.classList.add(options.prefix); - if (options.extraClasses) { - i.classList.add(options.extraClasses); - } - if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') { - i.classList.add(options.icon); - } else { - i.classList.add(options.prefix + '-' + options.icon); - } - if (options.spin && typeof options.spinClass === 'string') { - i.classList.add(options.spinClass); - } - if (options.iconColor) { - if (options.iconColor === 'white' || options.iconColor === 'black') { - i.classList.add('icon-' + options.iconColor); - } else { - i.style.color = options.iconColor; - } - } - if (options.iconSize) { - i.style.width = options.iconSize[0] + 'px'; - } - return i; - } - }, { - key: '_setIconStyles', - value: function _setIconStyles(img, name) { - var options = this.options; - var size = _leaflet2.default.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']); - var anchor = void 0; - - if (name === 'shadow') { - anchor = _leaflet2.default.point(options.shadowAnchor || options.iconAnchor); - } else { - anchor = _leaflet2.default.point(options.iconAnchor); - } - if (!anchor && size) { - anchor = size.divideBy(2, true); - } - img.className = 'vector-marker-' + name + ' ' + options.className; - if (anchor) { - img.style.marginLeft = -anchor.x + 'px'; - img.style.marginTop = -anchor.y + 'px'; - } - if (size) { - img.style.width = size.x + 'px'; - img.style.height = size.y + 'px'; - } - } - }]); - - return Icon; -}(_leaflet2.default.Icon); - -exports.default = Icon; \ No newline at end of file diff --git a/lib/VectorMarkers.js b/lib/VectorMarkers.js deleted file mode 100644 index 2794d63..0000000 --- a/lib/VectorMarkers.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - version: '1.0.0', - - Icon: _Icon2.default, - - icon: function icon(options) { - return new _Icon2.default(options); - } -}; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index b923c53..0000000 --- a/lib/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Icon = exports.VectorMarkers = undefined; - -var _leaflet = require('leaflet'); - -var _leaflet2 = _interopRequireDefault(_leaflet); - -var _VectorMarkers2 = require('./VectorMarkers'); - -var _VectorMarkers3 = _interopRequireDefault(_VectorMarkers2); - -var _Icon2 = require('./Icon'); - -var _Icon3 = _interopRequireDefault(_Icon2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.VectorMarkers = _VectorMarkers3.default; -exports.Icon = _Icon3.default; - - -_leaflet2.default.VectorMarkers = _VectorMarkers3.default; \ No newline at end of file From 0b23523d4905a611148ea775edebf4bd1379919b Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 16 May 2017 14:32:40 +0100 Subject: [PATCH 06/11] Ignored dist and lib folders. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 703ce36..c286a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ node_modules bower_components coverage npm-debug.log +/dist +/lib From 90376ccf390043187f3f96a5699d9d113052977e Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 1 Aug 2017 12:55:02 +0100 Subject: [PATCH 07/11] Allowed package to install alongside Leaflet v1.1.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e43240c..9c1ce50 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "postcss-loader": "^0.9.1" }, "peerDependencies": { - "leaflet": "^0.7.0" + "leaflet": "0.7.0 - 1.1.0" }, "devDependencies": { "babel-cli": "^6.9.0", From c65ceb98c2d2e8459fe9e7dfd4e15ec08e09dd03 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 1 Aug 2017 13:05:48 +0100 Subject: [PATCH 08/11] Revert "Ignored dist and lib folders." This reverts commit 0b23523d4905a611148ea775edebf4bd1379919b. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index c286a2c..703ce36 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,3 @@ node_modules bower_components coverage npm-debug.log -/dist -/lib From 0b764166f2311013c7f0e7f8ed054e8a189a7341 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Tue, 1 Aug 2017 13:07:53 +0100 Subject: [PATCH 09/11] Revert "Deleted dist and lib folders." This reverts commit 66d9a360c2379f177d6aae536a642d2edfca5e30. --- dist/leaflet-vector-markers.css | 54 ++++++ dist/leaflet-vector-markers.js | 262 +++++++++++++++++++++++++++++ dist/leaflet-vector-markers.min.js | 1 + lib/Icon.js | 138 +++++++++++++++ lib/VectorMarkers.js | 21 +++ lib/index.js | 26 +++ 6 files changed, 502 insertions(+) create mode 100644 dist/leaflet-vector-markers.css create mode 100644 dist/leaflet-vector-markers.js create mode 100644 dist/leaflet-vector-markers.min.js create mode 100644 lib/Icon.js create mode 100644 lib/VectorMarkers.js create mode 100644 lib/index.js diff --git a/dist/leaflet-vector-markers.css b/dist/leaflet-vector-markers.css new file mode 100644 index 0000000..8c1b857 --- /dev/null +++ b/dist/leaflet-vector-markers.css @@ -0,0 +1,54 @@ +/* +Author: Mathias Schneider +License: MIT +Version: 0.0.6 +*/ +/* Marker setup */ +.vector-marker { + width: 35px; + height: 46px; + position: absolute; + left: 0; + top: 0; + display: block; + text-align: center; } + .vector-marker path { + stroke: black; + stroke-opacity: 0.4; + stroke-width: 1; } + .vector-marker.not-accepted { + opacity: 0.5; } + +.vector-marker-shadow:before { + bottom: -13px; + box-shadow: 35px -10px 10px rgba(0, 0, 0, 0.4); + content: ""; + height: 40%; + position: absolute; + right: 21px; + -webkit-transform-origin: 50% 50%; + -ms-transform-origin: 50% 50%; + transform-origin: 50% 50%; + -webkit-transform: skew(150deg) rotate(-40deg); + -ms-transform: skew(150deg) rotate(-40deg); + transform: skew(150deg) rotate(-40deg); + width: 60%; + z-index: -1; } + +.vector-marker i { + position: absolute; + top: 8px; + left: 0; + width: 32px; + color: #333; + margin: auto; + display: inline-block; + font-size: 14px; } + +.vector-marker i.maki-icon { + width: 24px; + left: 4px; + top: 4px; } + +.vector-marker .icon-white { + color: #fff; } diff --git a/dist/leaflet-vector-markers.js b/dist/leaflet-vector-markers.js new file mode 100644 index 0000000..9026e44 --- /dev/null +++ b/dist/leaflet-vector-markers.js @@ -0,0 +1,262 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("leaflet")); + else if(typeof define === 'function' && define.amd) + define(["leaflet"], factory); + else if(typeof exports === 'object') + exports["VectorMarkers"] = factory(require("leaflet")); + else + root["VectorMarkers"] = factory(root["L"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Icon = exports.VectorMarkers = undefined; + + var _leaflet = __webpack_require__(1); + + var _leaflet2 = _interopRequireDefault(_leaflet); + + var _VectorMarkers2 = __webpack_require__(2); + + var _VectorMarkers3 = _interopRequireDefault(_VectorMarkers2); + + var _Icon2 = __webpack_require__(3); + + var _Icon3 = _interopRequireDefault(_Icon2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.VectorMarkers = _VectorMarkers3.default; + exports.Icon = _Icon3.default; + + + _leaflet2.default.VectorMarkers = _VectorMarkers3.default; + +/***/ }, +/* 1 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_1__; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _Icon = __webpack_require__(3); + + var _Icon2 = _interopRequireDefault(_Icon); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = { + version: '1.0.0', + + Icon: _Icon2.default, + + icon: function icon(options) { + return new _Icon2.default(options); + } + }; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + '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; }; }(); + + var _leaflet = __webpack_require__(1); + + var _leaflet2 = _interopRequireDefault(_leaflet); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var iconOptions = { + iconSize: [30, 50], + iconAnchor: [15, 50], + popupAnchor: [2, -40], + shadowAnchor: [39, 45], + shadowSize: [54, 51], + className: 'vector-marker', + prefix: 'fa', + spinClass: 'fa-spin', + extraIconClasses: '', + extraDivClasses: '', + icon: 'home', + markerColor: 'blue', + iconColor: 'white', + viewBox: '0 0 32 52' + }; + + var mapPin = 'M16,1 C7.7146,1 1,7.65636364 1,15.8648485 C1,24.0760606 16,51 16,51 C16,51 31,24.0760606 31,15.8648485 C31,7.65636364 24.2815,1 16,1 L16,1 Z'; + + var Icon = function (_Leaflet$Icon) { + _inherits(Icon, _Leaflet$Icon); + + function Icon(options) { + _classCallCheck(this, Icon); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); + + _leaflet2.default.Util.setOptions(_this, iconOptions); + _leaflet2.default.Util.setOptions(_this, options); + return _this; + } + + _createClass(Icon, [{ + key: 'createIcon', + value: function createIcon(oldIcon) { + var div = oldIcon && oldIcon.tagName === 'DIV' ? oldIcon : document.createElement('div'); + var options = this.options; + var pin_path = options.map_pin || mapPin; + + div.innerHTML = ''; + + if (options.icon) { + div.appendChild(this._createInner()); + } + + options.className += options.className.length > 0 ? ' ' + options.extraDivClasses : options.extraDivClasses; + this._setIconStyles(div, 'icon'); + this._setIconStyles(div, 'icon-' + options.markerColor); + return div; + } + }, { + key: 'createShadow', + value: function createShadow() { + var div = document.createElement('div'); + this._setIconStyles(div, 'shadow'); + return div; + } + }, { + key: '_createInner', + value: function _createInner() { + var i = document.createElement('i'); + var options = this.options; + + i.classList.add(options.prefix); + if (options.extraClasses) { + i.classList.add(options.extraClasses); + } + if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') { + i.classList.add(options.icon); + } else { + i.classList.add(options.prefix + '-' + options.icon); + } + if (options.spin && typeof options.spinClass === 'string') { + i.classList.add(options.spinClass); + } + if (options.iconColor) { + if (options.iconColor === 'white' || options.iconColor === 'black') { + i.classList.add('icon-' + options.iconColor); + } else { + i.style.color = options.iconColor; + } + } + if (options.iconSize) { + i.style.width = options.iconSize[0] + 'px'; + } + return i; + } + }, { + key: '_setIconStyles', + value: function _setIconStyles(img, name) { + var options = this.options; + var size = _leaflet2.default.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']); + var anchor = void 0; + + if (name === 'shadow') { + anchor = _leaflet2.default.point(options.shadowAnchor || options.iconAnchor); + } else { + anchor = _leaflet2.default.point(options.iconAnchor); + } + if (!anchor && size) { + anchor = size.divideBy(2, true); + } + img.className = 'vector-marker-' + name + ' ' + options.className; + if (anchor) { + img.style.marginLeft = -anchor.x + 'px'; + img.style.marginTop = -anchor.y + 'px'; + } + if (size) { + img.style.width = size.x + 'px'; + img.style.height = size.y + 'px'; + } + } + }]); + + return Icon; + }(_leaflet2.default.Icon); + + exports.default = Icon; + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff --git a/dist/leaflet-vector-markers.min.js b/dist/leaflet-vector-markers.min.js new file mode 100644 index 0000000..c76e82f --- /dev/null +++ b/dist/leaflet-vector-markers.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports?exports.VectorMarkers=t(require("leaflet")):e.VectorMarkers=t(e.L)}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=t.VectorMarkers=void 0;var r=o(2),i=n(r),s=o(3),a=n(s),c=o(1),l=n(c);t.VectorMarkers=a["default"],t.Icon=l["default"],i["default"].VectorMarkers=a["default"]},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var o=0;o',o.icon&&t.appendChild(this._createInner()),o.className+=o.className.length>0?" "+o.extraDivClasses:o.extraDivClasses,this._setIconStyles(t,"icon"),this._setIconStyles(t,"icon-"+o.markerColor),t}},{key:"createShadow",value:function(){var e=document.createElement("div");return this._setIconStyles(e,"shadow"),e}},{key:"_createInner",value:function(){var e=document.createElement("i"),t=this.options;return e.classList.add(t.prefix),t.extraClasses&&e.classList.add(t.extraClasses),t.icon.slice(0,t.prefix.length+1)===t.prefix+"-"?e.classList.add(t.icon):e.classList.add(t.prefix+"-"+t.icon),t.spin&&"string"==typeof t.spinClass&&e.classList.add(t.spinClass),t.iconColor&&("white"===t.iconColor||"black"===t.iconColor?e.classList.add("icon-"+t.iconColor):e.style.color=t.iconColor),t.iconSize&&(e.style.width=t.iconSize[0]+"px"),e}},{key:"_setIconStyles",value:function(e,t){var o=this.options,n=l["default"].point(o["shadow"===t?"shadowSize":"iconSize"]),r=void 0;r="shadow"===t?l["default"].point(o.shadowAnchor||o.iconAnchor):l["default"].point(o.iconAnchor),!r&&n&&(r=n.divideBy(2,!0)),e.className="vector-marker-"+t+" "+o.className,r&&(e.style.marginLeft=-r.x+"px",e.style.marginTop=-r.y+"px"),n&&(e.style.width=n.x+"px",e.style.height=n.y+"px")}}]),t}(l["default"].Icon);t["default"]=p},function(t,o){t.exports=e},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(1),i=n(r);t["default"]={version:"1.0.0",Icon:i["default"],icon:function(e){return new i["default"](e)}}}])}); \ No newline at end of file diff --git a/lib/Icon.js b/lib/Icon.js new file mode 100644 index 0000000..bee7160 --- /dev/null +++ b/lib/Icon.js @@ -0,0 +1,138 @@ +'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; }; }(); + +var _leaflet = require('leaflet'); + +var _leaflet2 = _interopRequireDefault(_leaflet); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var iconOptions = { + iconSize: [30, 50], + iconAnchor: [15, 50], + popupAnchor: [2, -40], + shadowAnchor: [39, 45], + shadowSize: [54, 51], + className: 'vector-marker', + prefix: 'fa', + spinClass: 'fa-spin', + extraIconClasses: '', + extraDivClasses: '', + icon: 'home', + markerColor: 'blue', + iconColor: 'white', + viewBox: '0 0 32 52' +}; + +var mapPin = 'M16,1 C7.7146,1 1,7.65636364 1,15.8648485 C1,24.0760606 16,51 16,51 C16,51 31,24.0760606 31,15.8648485 C31,7.65636364 24.2815,1 16,1 L16,1 Z'; + +var Icon = function (_Leaflet$Icon) { + _inherits(Icon, _Leaflet$Icon); + + function Icon(options) { + _classCallCheck(this, Icon); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Icon).call(this, options)); + + _leaflet2.default.Util.setOptions(_this, iconOptions); + _leaflet2.default.Util.setOptions(_this, options); + return _this; + } + + _createClass(Icon, [{ + key: 'createIcon', + value: function createIcon(oldIcon) { + var div = oldIcon && oldIcon.tagName === 'DIV' ? oldIcon : document.createElement('div'); + var options = this.options; + var pin_path = options.map_pin || mapPin; + + div.innerHTML = ''; + + if (options.icon) { + div.appendChild(this._createInner()); + } + + options.className += options.className.length > 0 ? ' ' + options.extraDivClasses : options.extraDivClasses; + this._setIconStyles(div, 'icon'); + this._setIconStyles(div, 'icon-' + options.markerColor); + return div; + } + }, { + key: 'createShadow', + value: function createShadow() { + var div = document.createElement('div'); + this._setIconStyles(div, 'shadow'); + return div; + } + }, { + key: '_createInner', + value: function _createInner() { + var i = document.createElement('i'); + var options = this.options; + + i.classList.add(options.prefix); + if (options.extraClasses) { + i.classList.add(options.extraClasses); + } + if (options.icon.slice(0, options.prefix.length + 1) === options.prefix + '-') { + i.classList.add(options.icon); + } else { + i.classList.add(options.prefix + '-' + options.icon); + } + if (options.spin && typeof options.spinClass === 'string') { + i.classList.add(options.spinClass); + } + if (options.iconColor) { + if (options.iconColor === 'white' || options.iconColor === 'black') { + i.classList.add('icon-' + options.iconColor); + } else { + i.style.color = options.iconColor; + } + } + if (options.iconSize) { + i.style.width = options.iconSize[0] + 'px'; + } + return i; + } + }, { + key: '_setIconStyles', + value: function _setIconStyles(img, name) { + var options = this.options; + var size = _leaflet2.default.point(options[name === 'shadow' ? 'shadowSize' : 'iconSize']); + var anchor = void 0; + + if (name === 'shadow') { + anchor = _leaflet2.default.point(options.shadowAnchor || options.iconAnchor); + } else { + anchor = _leaflet2.default.point(options.iconAnchor); + } + if (!anchor && size) { + anchor = size.divideBy(2, true); + } + img.className = 'vector-marker-' + name + ' ' + options.className; + if (anchor) { + img.style.marginLeft = -anchor.x + 'px'; + img.style.marginTop = -anchor.y + 'px'; + } + if (size) { + img.style.width = size.x + 'px'; + img.style.height = size.y + 'px'; + } + } + }]); + + return Icon; +}(_leaflet2.default.Icon); + +exports.default = Icon; \ No newline at end of file diff --git a/lib/VectorMarkers.js b/lib/VectorMarkers.js new file mode 100644 index 0000000..2794d63 --- /dev/null +++ b/lib/VectorMarkers.js @@ -0,0 +1,21 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Icon = require('./Icon'); + +var _Icon2 = _interopRequireDefault(_Icon); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + version: '1.0.0', + + Icon: _Icon2.default, + + icon: function icon(options) { + return new _Icon2.default(options); + } +}; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..b923c53 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,26 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Icon = exports.VectorMarkers = undefined; + +var _leaflet = require('leaflet'); + +var _leaflet2 = _interopRequireDefault(_leaflet); + +var _VectorMarkers2 = require('./VectorMarkers'); + +var _VectorMarkers3 = _interopRequireDefault(_VectorMarkers2); + +var _Icon2 = require('./Icon'); + +var _Icon3 = _interopRequireDefault(_Icon2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.VectorMarkers = _VectorMarkers3.default; +exports.Icon = _Icon3.default; + + +_leaflet2.default.VectorMarkers = _VectorMarkers3.default; \ No newline at end of file From dfcfb1f8fe1a8234c22c24df16fc865e184f2577 Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Thu, 7 Sep 2017 11:11:50 +0100 Subject: [PATCH 10/11] Changed peer dependency semver expression to include leaflet v1.x.x. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c1ce50..22917af 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "postcss-loader": "^0.9.1" }, "peerDependencies": { - "leaflet": "0.7.0 - 1.1.0" + "leaflet": "^0.7.0 || ^1.0.0" }, "devDependencies": { "babel-cli": "^6.9.0", From 90ef9b81a87611fc1ef20eac8c4f5581287a4d7f Mon Sep 17 00:00:00 2001 From: "adrian.flood" Date: Thu, 7 Sep 2017 15:30:23 +0100 Subject: [PATCH 11/11] Updated leaflet dependency to allow later versions. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 22917af..ce19614 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "autoprefixer": "^6.3.7", - "leaflet": "^0.7.0", + "leaflet": "^0.7.0 || ^1.0.0", "postcss-loader": "^0.9.1" }, "peerDependencies": {