Skip to content

Commit

Permalink
update frontend to show 15 and 19 dc lookup result
Browse files Browse the repository at this point in the history
  • Loading branch information
cswbrian committed Jun 26, 2019
1 parent 782d76c commit bac79df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
12 changes: 6 additions & 6 deletions web/src/components/ResultCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@
<span>地區</span>
</v-list-tile-content>
<v-list-tile-content class="align-end">
<span>{{ district.esubdistrict }}</span>
<span>{{ district.csubdistrict }}</span>
<span>{{ district['2015'].esubdistrict }}</span>
<span>{{ district['2015'].csubdistrict }}</span>
</v-list-tile-content>
</v-list-tile>
<v-divider></v-divider>
<v-list-tile>
<v-list-tile-content>
<span>District Council Constituency Area</span>
<span>區議會選區</span>
<span>District Council Constituency Area (2019)</span>
<span>區議會選區 (2019)</span>
</v-list-tile-content>
<v-list-tile-content class="align-end">
<span>{{ district.ename }}</span>
<span>{{ district.cname }}</span>
<span>{{ district['2019'].ename }}</span>
<span>{{ district['2019'].cname }} ({{ district['2019'].code }})</span>
</v-list-tile-content>
</v-list-tile>
<v-divider></v-divider>
Expand Down
23 changes: 13 additions & 10 deletions web/src/pages/TableAddressSearcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ export default {
value: "subdistrict_name"
},
{
text: "區議會選區",
value: "dc_name"
text: "區議會選區(2015)",
value: "dc_name_15"
},
{
text: "區議會選區(2019)",
value: "dc_name_19"
},
{
text: "緯度",
Expand Down Expand Up @@ -146,17 +150,16 @@ export default {
// TODO: english address
const results = this.results.map((searchResults, index) => {
const result = searchResults[0];
const dcLookupResult = dclookup.dcNameFromCoordinates(
result.coordinate().lat,
result.coordinate().lng
)
let json = {
address: this.addressesToSearch[index],
full_address: result.fullAddress("chi"),
subdistrict_name: dclookup.dcNameFromCoordinates(
result.coordinate().lat,
result.coordinate().lng
).csubdistrict,
dc_name: dclookup.dcNameFromCoordinates(
result.coordinate().lat,
result.coordinate().lng
).cname,
subdistrict_name: dcLookupResult['2015'].csubdistrict,
dc_name_15: `${dcLookupResult['2015'].cname} (${dcLookupResult['2015'].code})`,
dc_name_19: `${dcLookupResult['2019'].cname} (${dcLookupResult['2019'].code})`,
lat: result.coordinate().lat,
lng: result.coordinate().lng
};
Expand Down

0 comments on commit bac79df

Please sign in to comment.