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/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..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'> - + 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": { diff --git a/px-map-behavior-popup.es6.js b/px-map-behavior-popup.es6.js index 67260d9..586ad80 100644 --- a/px-map-behavior-popup.es6.js +++ b/px-map-behavior-popup.es6.js @@ -41,6 +41,14 @@ value: false }, + /** + * Margin of the marker popup container + */ + margin: { + type: String, + value: '15px' + }, + /** * Max width of popup container */ @@ -115,6 +123,7 @@ getInstOptions() { return { opened: this.opened, + margin: this.margin, minWidth: this.minWidth, maxWidth: this.maxWidth, }; @@ -385,15 +394,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 +428,7 @@ } return ` -
+
${tmplFnIf(imgTmpl, imgSrc)}
${ @@ -518,12 +527,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); }