From c9bef6bcfec3719d8f078fe072d4588db0551113 Mon Sep 17 00:00:00 2001 From: Vikas Rana Date: Tue, 18 Apr 2017 13:40:09 +0530 Subject: [PATCH 01/38] add additional marker colors and icons --- .../google-maps-markup/component.js | 31 +++++++++++++++++++ addon/utils/tools.js | 8 ++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/addon/components/google-maps-markup/component.js b/addon/components/google-maps-markup/component.js index 776c623..3e07570 100644 --- a/addon/components/google-maps-markup/component.js +++ b/addon/components/google-maps-markup/component.js @@ -201,6 +201,25 @@ export default Ember.Component.extend(ParentMixin, { }); }, + getMarkerIcon(marker){ + let icon = { + point: { + red: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + yellow: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + }, + pin: { + red: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + yellow: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + } + }; + + return { + url: icon[marker.icon][marker.color], + }; + }, + + + actions: { updateOptionValue(tool, prop, value) { set(tool, prop, value); @@ -680,7 +699,9 @@ export default Ember.Component.extend(ParentMixin, { let plotter; let onClick = run.bind(this, (event) => { + let activeLayer = this.get('activeLayer'); let toolId = this.get('toolId'); + let tool = this.getTool(toolId); let mode = this.get('mode'); let mapDiv = map.getDiv(); let target = event.target; @@ -689,7 +710,17 @@ export default Ember.Component.extend(ParentMixin, { if (mode === 'draw') { if (withinMap && toolId === 'freeFormPolygon') { this.enableFreeFormPolygon(); + } else if (withinMap && toolId === 'marker') { + let style = { + icon: this.getMarkerIcon({ + icon: 'point', + color: 'red', + }) + }; + + activeLayer.data.setStyle(style); } + return; } diff --git a/addon/utils/tools.js b/addon/utils/tools.js index edb2a14..a00fa6d 100644 --- a/addon/utils/tools.js +++ b/addon/utils/tools.js @@ -19,7 +19,13 @@ export default { id: 'marker', dataId: 'Point', name: 'Marker', - title: 'Marker Tool' + title: 'Marker Tool', + options: [ + { name: 'Color', type: 'color', id: 'style.color' } + ], + style: { + color: '#374046' + } }, polyline: { id: 'polyline', From 7475e503067cc815933e1449efee426371b587bb Mon Sep 17 00:00:00 2001 From: Vikas Rana Date: Tue, 18 Apr 2017 17:40:35 +0530 Subject: [PATCH 02/38] add additional marker colors and icons --- .../google-maps-markup/component.js | 19 +++++++-- .../google-maps-markup/template.hbs | 26 ++++++++++++ addon/utils/tools.js | 41 ++++++++++++++++++- 3 files changed, 82 insertions(+), 4 deletions(-) diff --git a/addon/components/google-maps-markup/component.js b/addon/components/google-maps-markup/component.js index 3e07570..ef09d61 100644 --- a/addon/components/google-maps-markup/component.js +++ b/addon/components/google-maps-markup/component.js @@ -204,10 +204,14 @@ export default Ember.Component.extend(ParentMixin, { getMarkerIcon(marker){ let icon = { point: { + blue: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + green: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', red: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', yellow: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', }, pin: { + blue: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', + green: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', red: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', yellow: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png', } @@ -221,6 +225,10 @@ export default Ember.Component.extend(ParentMixin, { actions: { + toggleDropdown(name) { + this.toggleProperty(name); + }, + updateOptionValue(tool, prop, value) { set(tool, prop, value); }, @@ -713,12 +721,17 @@ export default Ember.Component.extend(ParentMixin, { } else if (withinMap && toolId === 'marker') { let style = { icon: this.getMarkerIcon({ - icon: 'point', - color: 'red', + icon: tool.icon.id, + color: tool.customColor.id, }) }; - activeLayer.data.setStyle(style); + let isDefaultIcon = tool.icon.id === tool.default.icon.id; + let isDefaultColor = tool.customColor.id === tool.default.customColor.id; + + if (! isDefaultIcon || ! isDefaultColor) { + activeLayer.data.setStyle(style); + } } return; diff --git a/addon/components/google-maps-markup/template.hbs b/addon/components/google-maps-markup/template.hbs index 26fe82d..a8047e4 100644 --- a/addon/components/google-maps-markup/template.hbs +++ b/addon/components/google-maps-markup/template.hbs @@ -38,6 +38,32 @@ {{color-palette selected=(get activeTool opt.id) onselect=(action 'updateOptionValue' activeTool opt.id)}} {{/if}} + {{#if (is-equal opt.type 'icon')}} + + {{/if}} + {{#if (is-equal opt.type 'customColor')}} + + {{/if}} {{/each}} {{/if}} diff --git a/addon/utils/tools.js b/addon/utils/tools.js index a00fa6d..6e12d01 100644 --- a/addon/utils/tools.js +++ b/addon/utils/tools.js @@ -21,10 +21,49 @@ export default { name: 'Marker', title: 'Marker Tool', options: [ - { name: 'Color', type: 'color', id: 'style.color' } + { name: 'Icon', type: 'icon', id: 'icon.id', display: 'icon.display' }, + { name: 'Icon', type: 'customColor', id: 'icon.id', display: 'icon.display' } ], style: { color: '#374046' + }, + icons: [{ + id: 'point', + display: 'Point' + }, { + id: 'pin', + display: 'Pin' + }], + icon:{ + id: 'point', + display: 'Point' + }, + customColors: [{ + id: 'red', + display: 'Red', + }, { + id: 'green', + display: 'Green', + }, { + id: 'blue', + display: 'BLue', + }, { + id: 'yellow', + display: 'Yellow', + }], + customColor: { + id: 'red', + display: 'Red', + }, + default: { + customColor: { + id: 'red', + display: 'Red', + }, + icon:{ + id: 'point', + display: 'Point' + } } }, polyline: { From d45a787471f3532acbced44b54c15e3b295fd0ec Mon Sep 17 00:00:00 2001 From: Vikas Rana Date: Tue, 18 Apr 2017 18:01:09 +0530 Subject: [PATCH 03/38] add additional marker colors and icons --- addon/components/google-maps-markup/component.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addon/components/google-maps-markup/component.js b/addon/components/google-maps-markup/component.js index ef09d61..a0ac741 100644 --- a/addon/components/google-maps-markup/component.js +++ b/addon/components/google-maps-markup/component.js @@ -238,6 +238,9 @@ export default Ember.Component.extend(ParentMixin, { }, changeTool(toolId) { + this.resetAllLayers(); + this.clearListeners(); + let markupDataService = this.get('markupData'); let activeLayer = this.get('activeLayer'); let map = this.get('map'); @@ -249,8 +252,7 @@ export default Ember.Component.extend(ParentMixin, { this.set('drawFinished', false); markupDataService.set('activeTool', tool.id); - this.resetAllLayers(); - this.clearListeners(); + if (activeLayer) { if (tool.id === 'pan') { @@ -287,6 +289,8 @@ export default Ember.Component.extend(ParentMixin, { event.stop(); }); listeners.pushObjects([ mapListener, dataListener ]); + }else if (tool.dataId === 'Point') { + activeLayer.data.setDrawingMode(tool.dataId); } else if (tool.dataId) { activeLayer.data.setDrawingMode(tool.dataId); activeLayer.data.setStyle(tool.style); @@ -731,6 +735,8 @@ export default Ember.Component.extend(ParentMixin, { if (! isDefaultIcon || ! isDefaultColor) { activeLayer.data.setStyle(style); + } else { + activeLayer.data.setStyle(); } } From 712b76be6fc4004a6b35906f373ea6d699318b9a Mon Sep 17 00:00:00 2001 From: Vikas Rana Date: Wed, 19 Apr 2017 15:18:26 +0530 Subject: [PATCH 04/38] custom color code removed --- .../google-maps-markup/component.js | 8 ++--- .../google-maps-markup/template.hbs | 13 --------- addon/utils/tools.js | 29 +------------------ 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/addon/components/google-maps-markup/component.js b/addon/components/google-maps-markup/component.js index a0ac741..7c13abe 100644 --- a/addon/components/google-maps-markup/component.js +++ b/addon/components/google-maps-markup/component.js @@ -726,18 +726,14 @@ export default Ember.Component.extend(ParentMixin, { let style = { icon: this.getMarkerIcon({ icon: tool.icon.id, - color: tool.customColor.id, }) }; - let isDefaultIcon = tool.icon.id === tool.default.icon.id; - let isDefaultColor = tool.customColor.id === tool.default.customColor.id; - - if (! isDefaultIcon || ! isDefaultColor) { + /*if (! isDefaultIcon || ! isDefaultColor) { activeLayer.data.setStyle(style); } else { activeLayer.data.setStyle(); - } + }*/ } return; diff --git a/addon/components/google-maps-markup/template.hbs b/addon/components/google-maps-markup/template.hbs index a8047e4..6ae4857 100644 --- a/addon/components/google-maps-markup/template.hbs +++ b/addon/components/google-maps-markup/template.hbs @@ -51,19 +51,6 @@ {{/if}} - {{#if (is-equal opt.type 'customColor')}} - - {{/if}} {{/each}} {{/if}} diff --git a/addon/utils/tools.js b/addon/utils/tools.js index 6e12d01..2e4d484 100644 --- a/addon/utils/tools.js +++ b/addon/utils/tools.js @@ -21,8 +21,8 @@ export default { name: 'Marker', title: 'Marker Tool', options: [ + { name: 'Color', type: 'color', id: 'style.color' }, { name: 'Icon', type: 'icon', id: 'icon.id', display: 'icon.display' }, - { name: 'Icon', type: 'customColor', id: 'icon.id', display: 'icon.display' } ], style: { color: '#374046' @@ -38,33 +38,6 @@ export default { id: 'point', display: 'Point' }, - customColors: [{ - id: 'red', - display: 'Red', - }, { - id: 'green', - display: 'Green', - }, { - id: 'blue', - display: 'BLue', - }, { - id: 'yellow', - display: 'Yellow', - }], - customColor: { - id: 'red', - display: 'Red', - }, - default: { - customColor: { - id: 'red', - display: 'Red', - }, - icon:{ - id: 'point', - display: 'Point' - } - } }, polyline: { id: 'polyline', From 11691f0e2102712a308db929bfc4e21c9f47ff96 Mon Sep 17 00:00:00 2001 From: Vikas Rana Date: Wed, 19 Apr 2017 20:35:46 +0530 Subject: [PATCH 05/38] Ember Bootstrap drop down component added and marker icon drop down completed --- .../google-maps-markup/template.hbs | 24 +++++++++++-------- addon/utils/tools.js | 17 +++++++++---- app/styles/app.less | 2 ++ package.json | 2 ++ public/images/ic_person_pin_black_24px.svg | 4 ++++ .../ic_person_pin_circle_black_24px.svg | 9 +++++++ public/images/ic_place_black_24px.svg | 4 ++++ 7 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 app/styles/app.less create mode 100644 public/images/ic_person_pin_black_24px.svg create mode 100644 public/images/ic_person_pin_circle_black_24px.svg create mode 100644 public/images/ic_place_black_24px.svg diff --git a/addon/components/google-maps-markup/template.hbs b/addon/components/google-maps-markup/template.hbs index 6ae4857..bb3cda7 100644 --- a/addon/components/google-maps-markup/template.hbs +++ b/addon/components/google-maps-markup/template.hbs @@ -39,16 +39,20 @@ {{/if}} {{#if (is-equal opt.type 'icon')}} -