Skip to content

Commit

Permalink
Merge pull request #100 from wingkwong/master
Browse files Browse the repository at this point in the history
Numbering the pins corresponding to the row index
  • Loading branch information
cswbrian authored Feb 16, 2019
2 parents 038f368 + f896696 commit 95a62b7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
11 changes: 8 additions & 3 deletions web/src/components/VueLayerMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
<vl-geom-point :coordinates="feature.geometry.coordinates"></vl-geom-point>
<vl-style-box v-if="feature.properties.selected">
<vl-style-icon
:src="images.selectedPin"
:src="generateDynamicPin(index, true)"
:scale="0.5"
:anchor="[0.1, 0.5]"
:size="[128, 128]"
></vl-style-icon>
</vl-style-box>
<vl-style-box v-else>
<vl-style-icon
:src="images.pin"
:src="generateDynamicPin(index, false)"
:scale="0.5"
:anchor="[0.1, 0.5]"
:size="[128, 128]"
Expand Down Expand Up @@ -91,7 +91,12 @@
return this.selectedFeatures[0].properties.index === marker.index;
},
featureUpdated: function(features) {
},
generateDynamicPin: function(index, isSelected) {
let selectedColor = "FFFFFF";
let normalColor = "009688";
return "https://chart.googleapis.com/chart?chst=d_map_spin&chld=1.2|0|" + (isSelected == true ? selectedColor : normalColor) + "|32|_|" + ( index + 1 );
}
},
// watch: {
Expand Down
24 changes: 15 additions & 9 deletions web/src/utils/ga-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function trackEvent(component, param) {
/**
* Track the user has initialize a single search
* @param {Component} component
* @param {String} address
* @param {int} searchSize
*/
export const trackMapSearch = function (component, searchSize) {
trackEvent(component, {
Expand All @@ -32,8 +32,8 @@ export const trackMapSearch = function (component, searchSize) {

/**
* Track the user has selected the pin in map mode
* @param {*} component
* @param {*} address
* @param {Component} component
* @param {String} address
*/
export const trackPinSelected = function (component, address) {
trackEvent(component, {
Expand All @@ -46,7 +46,7 @@ export const trackPinSelected = function (component, address) {
/**
* TODO: user give us some rating
* @param {Component} component
* @param {*} address
* @param {String} address
* @param {int} satisfication 1-100. 100 = satisfy
*/
export const trackSingleSearchSatisfication = function (component, address, satisfication) {
Expand All @@ -59,8 +59,8 @@ export const trackSingleSearchSatisfication = function (component, address, sati

/**
* Track the user has initialize a batch search
* @param {*} component
* @param {*} addresses
* @param {Component} component
* @param {int} batchSize
*/
export const trackTableSearch = function (component, batchSize) {
trackEvent(component, {
Expand All @@ -72,8 +72,8 @@ export const trackTableSearch = function (component, batchSize) {

/**
* Track the user has clicked on the download button
* @param {*} component
* @param {*} batchSize
* @param {Component} component
* @param {int} batchSize
*/
export const trackDownloadCSV = function (component, batchSize) {
trackEvent(component, {
Expand All @@ -84,7 +84,12 @@ export const trackDownloadCSV = function (component, batchSize) {
}



/**
* Track the user has toggled a filter option
* @param {Component} component
* @param {String} optionKey
* @param {Boolean} isOn
*/
export const trackToggleFilterOption = function (component, optionKey, isOn) {
trackEvent(component, {
eventCategory: GA_CATEGORY_SINGLE_SEARCH,
Expand All @@ -99,6 +104,7 @@ export const trackToggleFilterOption = function (component, optionKey, isOn) {
* Track the user has initialize a single search
* @param {Component} component
* @param {String} address
* @param {Boolean} satisfied
*/
export const trackSingleSearchSatisfied = function (component, address, satisfied) {
trackEvent(component, {
Expand Down

0 comments on commit 95a62b7

Please sign in to comment.