Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional marker colors and icons #17

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c9bef6b
add additional marker colors and icons
vikasrana1989 Apr 18, 2017
7475e50
add additional marker colors and icons
vikasrana1989 Apr 18, 2017
d45a787
add additional marker colors and icons
vikasrana1989 Apr 18, 2017
712b76b
custom color code removed
vikasrana1989 Apr 19, 2017
11691f0
Ember Bootstrap drop down component added and marker icon drop down c…
vikasrana1989 Apr 19, 2017
e7e0a87
comment update
vikasrana1989 Apr 19, 2017
a4f6de2
ember-bootstrap addon removed
vikasrana1989 Apr 20, 2017
5c2a92b
Icon drop down updated with select tag
vikasrana1989 Apr 20, 2017
cdef4b3
Dynamic image marker added on map
vikasrana1989 Apr 20, 2017
529c642
default option value is not getting updated
vidyadharbhatt Apr 21, 2017
bd2aad5
hover added
vidyadharbhatt Apr 21, 2017
e854818
Marker icon color dynamically set
vikasrana1989 Apr 21, 2017
10d8440
Marker hoever path updated
vikasrana1989 Apr 21, 2017
92dca5b
Marker hoever path updated
vikasrana1989 Apr 21, 2017
1e8f60f
default hover color
vidyadharbhatt Apr 21, 2017
6a8aa72
Icon drop down color updated
vikasrana1989 Apr 21, 2017
47bbc78
Merge branch 'marker-icon' of https://github.com/vikasrana1989/google…
vikasrana1989 Apr 21, 2017
16b628e
Marker Icon custom hover removed + Marker Icon Hover color set to red
vikasrana1989 Apr 24, 2017
d58cb39
Marker Icon last used to set default
vikasrana1989 Apr 24, 2017
ce48af9
color dropdown removed when default icon on marker
Ganesh4 Apr 25, 2017
0043f71
color dropdown removed when default icon on marker
Ganesh4 Apr 25, 2017
20f98a0
marker pin icon path updated
vidyadharbhatt Apr 26, 2017
f0258d0
ember power selected applied
Ganesh4 Apr 29, 2017
19a83de
ember power select applied
Ganesh4 May 1, 2017
1af63b9
ember power select applied on marker
Ganesh4 May 2, 2017
70f76f9
Marker Icon dynamic hover color set
vikasrana1989 May 3, 2017
af5cf3e
Merge branch 'marker-icon' of https://github.com/Ganesh4/google-maps-…
vikasrana1989 May 3, 2017
5e8fab4
jsHint error removed from marker icon
Ganesh4 May 3, 2017
51e9b65
Merge pull request #5 from Ganesh4/jshinterr-marker
vikasrana1989 May 3, 2017
95f7538
power select updated
vikasrana1989 May 4, 2017
163b8d7
ember power selection
Ganesh4 May 4, 2017
756b789
Merge branch 'marker-icon' of https://github.com/vikasrana1989/google…
vikasrana1989 May 4, 2017
de9dce8
drop_down class added
Ganesh4 May 4, 2017
b45a2c6
code merged with vikas marker icon
Ganesh4 May 4, 2017
2e94535
code merged
vikasrana1989 May 8, 2017
6c83041
Marker Icon updated with dropdown option
vikasrana1989 May 11, 2017
7d2c689
Merge pull request #7 from vikasrana1989/marker-icon-new
vikasrana1989 May 11, 2017
8c930d3
code merged
vikasrana1989 May 11, 2017
e329b53
code update
vikasrana1989 May 11, 2017
4800f39
code update
vikasrana1989 May 11, 2017
6a3e0ac
style updated
vidyadharbhatt May 12, 2017
3ae2bf4
New Marker drop down Added(#8)
Ganesh4 May 12, 2017
40c0b12
Marker Dropdown icon style updated (#9)
Ganesh4 May 16, 2017
35d7696
code update
vikasrana1989 May 19, 2017
a11ab0e
Marker Icon position issue fixed
vikasrana1989 May 19, 2017
31cc0bf
marker removed on clear all button
vikasrana1989 May 19, 2017
b826b8a
Merge branch 'marker-icon' of https://github.com/vikasrana1989/google…
vikasrana1989 May 19, 2017
4a99ac9
hover marker selected style fixed
vikasrana1989 May 19, 2017
349144e
Merge branch 'marker-icon' of https://github.com/vikasrana1989/google…
vikasrana1989 May 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions addon/components/google-maps-markup/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,34 @@ 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',
}
};

return {
url: icon[marker.icon][marker.color],
};
},



actions: {
toggleDropdown(name) {
this.toggleProperty(name);
},

updateOptionValue(tool, prop, value) {
set(tool, prop, value);
},
Expand All @@ -211,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');
Expand All @@ -222,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') {
Expand Down Expand Up @@ -260,6 +289,8 @@ export default Ember.Component.extend(ParentMixin, {
event.stop();
});
listeners.pushObjects([ mapListener, dataListener ]);
}else if (tool.dataId === 'Point') {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nitpick

activeLayer.data.setDrawingMode(tool.dataId);
} else if (tool.dataId) {
activeLayer.data.setDrawingMode(tool.dataId);
activeLayer.data.setStyle(tool.style);
Expand Down Expand Up @@ -680,7 +711,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;
Expand All @@ -689,7 +722,20 @@ 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: tool.icon.id,
})
};

/*if (! isDefaultIcon || ! isDefaultColor) {
activeLayer.data.setStyle(style);
} else {
activeLayer.data.setStyle();
}*/
}

return;
}

Expand Down
17 changes: 17 additions & 0 deletions addon/components/google-maps-markup/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@
{{color-palette selected=(get activeTool opt.id) onselect=(action 'updateOptionValue' activeTool opt.id)}}
</div>
{{/if}}
{{#if (is-equal opt.type 'icon')}}
<div class="form-group">
<label>{{opt.name}}</label>
{{#bs-dropdown as |dd|}}
{{#dd.button}}{{activeTool.icon.display}} <img src={{activeTool.icon.path}} height="10px" width="10px"/>{{/dd.button}}
{{#dd.menu as |ddm|}}
{{#each activeTool.icons as |icon|}}
<div {{action 'updateOptionValue' activeTool 'icon' icon}}>
<img src={{icon.path}} height="10px" width="10px">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to render the svgs directly without making a file.

{{#ddm.item}}{{icon.display}}{{/ddm.item}}
{{ddm.divider}}
</div>
{{/each}}
{{/dd.menu}}
{{/bs-dropdown}}
</div>
{{/if}}
{{/each}}
</form>
{{/if}}
Expand Down
27 changes: 26 additions & 1 deletion addon/utils/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,32 @@ export default {
id: 'marker',
dataId: 'Point',
name: 'Marker',
title: 'Marker Tool'
title: 'Marker Tool',
options: [
{ name: 'Color', type: 'color', id: 'style.color' },
{ name: 'Icon', type: 'icon', id: 'icon.id', display: 'icon.display' },
],
style: {
color: '#374046'
},
icons: [{
id: 'default',
display: 'Default',
path: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png'
},{
id: 'point',
display: 'Point',
path: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png'
}, {
id: 'pin',
display: 'Pin',
path: 'google-maps-markup/images/ic_place_black_24px.svg'
}],
icon: {
id: 'default',
display: 'Default',
path: 'google-maps-markup/images/spotlight-poi-highlighted_hdpi.png'
},
},
polyline: {
id: 'polyline',
Expand Down
2 changes: 2 additions & 0 deletions app/styles/app.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

@import "ember-bootstrap/bootstrap";
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
"ember-uuid": "1.0.0"
},
"devDependencies": {
"bootstrap": "3.3.7",
"broccoli-asset-rev": "^2.4.5",
"broccoli-merge-trees": "^1.2.1",
"broccoli-static-compiler": "^0.2.1",
"ember-bootstrap": "1.0.0-alpha.10",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not use this heavy addon since we don't use it anywhere else in MapGeo, and most likely we'll be updating to material-design or BS4 in the near future.

"ember-cli": "2.10.0",
"ember-cli-app-version": "^2.0.0",
"ember-cli-blanket": "^0.9.9",
Expand Down
4 changes: 4 additions & 0 deletions public/images/ic_person_pin_black_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/ic_person_pin_circle_black_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/images/ic_place_black_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.