From 566922951f7a1761164df5d8c711973ee8ae23a0 Mon Sep 17 00:00:00 2001 From: Hanzhang Luo Date: Mon, 20 Aug 2018 13:50:12 -0700 Subject: [PATCH 1/4] add margin to popup container --- demo/px-map-marker-group-demo.html | 1 + demo/px-map-popup-info-demo.html | 2 +- px-map-behavior-popup.es6.js | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/demo/px-map-marker-group-demo.html b/demo/px-map-marker-group-demo.html index 84694b2..858dca6 100644 --- a/demo/px-map-marker-group-demo.html +++ b/demo/px-map-marker-group-demo.html @@ -200,6 +200,7 @@ "popup-base": "data-popup", "popup-title": "Cabrillo National Monument", "popup-opened": "true", + "popup-margin": "10px", "popup-maxWidth": "600", "popup-minWidth": "500", "popup-data": { diff --git a/demo/px-map-popup-info-demo.html b/demo/px-map-popup-info-demo.html index e270b99..70df23a 100644 --- a/demo/px-map-popup-info-demo.html +++ b/demo/px-map-popup-info-demo.html @@ -65,7 +65,7 @@ attribution-prefix='Leaflet | © OpenStreetMap contributors'> - + diff --git a/px-map-behavior-popup.es6.js b/px-map-behavior-popup.es6.js index 67260d9..18da399 100644 --- a/px-map-behavior-popup.es6.js +++ b/px-map-behavior-popup.es6.js @@ -41,6 +41,11 @@ value: false }, + margin: { + type: String, + value: '15px' + }, + /** * Max width of popup container */ @@ -115,6 +120,7 @@ getInstOptions() { return { opened: this.opened, + margin: this.margin, minWidth: this.minWidth, maxWidth: this.maxWidth, }; @@ -385,15 +391,15 @@ _createPopup(settings={}) { // Assign settings and create content this.settings = settings; - const { title, description, imgSrc, styleScope, maxWidth, minWidth, customContent } = settings; - const content = this._generatePopupContent(title, description, imgSrc, customContent); + const { title, description, imgSrc, styleScope, maxWidth, margin, minWidth, customContent } = settings; + const content = this._generatePopupContent(margin, title, description, imgSrc, customContent); const className = `map-popup-info ${styleScope||''}` this.initialize({ className, maxWidth, minWidth, customContent }); this.setContent(content); } - _generatePopupContent(title, description, imgSrc, customContent = []) { + _generatePopupContent(margin, title, description, imgSrc, customContent = []) { const tmplFnIf = (fn, ...vals) => vals.length && vals[0] !== undefined ? fn.call(this, ...vals) : ''; @@ -419,7 +425,7 @@ } return ` -
+
${tmplFnIf(imgTmpl, imgSrc)}
${ @@ -518,12 +524,12 @@ // so hopefully it won't cause grief _createPopup(settings={}, config={}) { this.settings = settings; - const { title, data, styleScope, maxWidth, minWidth } = settings; + const { title, data, styleScope, margin, maxWidth, minWidth } = settings; const content = this._generatePopupContent(title, data); const className = `map-popup-data ${styleScope||''}` - this.initialize({ className, maxWidth, minWidth }); + this.initialize({ className, margin, maxWidth, minWidth }); this.setContent(content); } From 1d02b7438b0c82fbd00970044ca6a25edfe5f9ae Mon Sep 17 00:00:00 2001 From: Hanzhang Luo Date: Mon, 20 Aug 2018 16:29:13 -0700 Subject: [PATCH 2/4] remove test string --- demo/px-map-popup-info-demo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/px-map-popup-info-demo.html b/demo/px-map-popup-info-demo.html index 70df23a..8b64d5c 100644 --- a/demo/px-map-popup-info-demo.html +++ b/demo/px-map-popup-info-demo.html @@ -65,7 +65,7 @@ attribution-prefix='Leaflet | © OpenStreetMap contributors'> - + From 11e11f9236957466ea8d6d5ff48b48aef01c8957 Mon Sep 17 00:00:00 2001 From: Hanzhang Luo Date: Tue, 21 Aug 2018 10:40:49 -0700 Subject: [PATCH 3/4] add comment for margin property --- px-map-behavior-popup.es6.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/px-map-behavior-popup.es6.js b/px-map-behavior-popup.es6.js index 18da399..586ad80 100644 --- a/px-map-behavior-popup.es6.js +++ b/px-map-behavior-popup.es6.js @@ -41,6 +41,9 @@ value: false }, + /** + * Margin of the marker popup container + */ margin: { type: String, value: '15px' From c5a336b920532117a489fbff458d49119af0d9d3 Mon Sep 17 00:00:00 2001 From: Hanzhang Luo Date: Tue, 21 Aug 2018 14:00:05 -0700 Subject: [PATCH 4/4] bump version --- bower.json | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index e727140..d9e8b87 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "px-map", - "version": "3.4.0", + "version": "3.8.0", "description": "A lightweight framework for building interactive maps with web components", "main": [ "px-map.html" @@ -67,4 +67,4 @@ } }, "license": "Apache-2.0" -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 5f927a4..73acd98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "px-map", - "version": "3.5.0", + "version": "3.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 06c93f1..2fac7d3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "px-map", "author": "General Electric", "description": "A lightweight framework for building interactive maps with web components", - "version": "3.6.0", + "version": "3.8.0", "private": false, "extName": null, "repository": {