Skip to content

Commit

Permalink
Fix Distance Bug (#28)
Browse files Browse the repository at this point in the history
* add download info function

* upload to geojson not finished

* automatic update geojson

* add two components

* add download info function

* adjust adminDisaster

* small fix

* fix location bug

* map multiple icons

* adminDisaster

* fix distance bug
  • Loading branch information
rakechen-0307 authored May 12, 2024
1 parent 1b33099 commit 7db0ee6
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions Taipei-City-Dashboard-FE/src/components/map/MapContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function findClosestHospital(userLat, userLon, hospitals) {

for (let hospital of hospitals) {
const { inform } = hospital.properties;
const [lat, lon] = hospital.geometry.coordinates;
const [lon, lat] = hospital.geometry.coordinates;

if (inform === "N") {
const distance = calculateDistance(userLat, userLon, lat, lon);
Expand Down Expand Up @@ -143,7 +143,6 @@ onMounted(() => {
});

const showTooltip = ref(false);

</script>

<template>
Expand All @@ -163,9 +162,8 @@ const showTooltip = ref(false);
color: districtLayer
? 'var(--color-highlight)'
: 'var(--color-component-background)',
marginTop: '50px',
marginTop: '50px',
}"

@click="toggleDistrictLayer"
>
Expand Down Expand Up @@ -263,20 +261,20 @@ const showTooltip = ref(false);
<style scoped lang="scss">
.input {
position: absolute;
right: 20px;
bottom: 60px;
width: 70px;
height: 70px;
border-radius: 50%;
background-color: var(--color-component-background);
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s, color 0.2s;
right: 20px;
bottom: 60px;
width: 70px;
height: 70px;
border-radius: 50%;
background-color: var(--color-component-background);
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s, color 0.2s;
font-size: 32px;
&:hover {
background-color: var(--color-highlight);
}
&:hover {
background-color: var(--color-highlight);
}
.icon {
color: white;
font-family: var(--font-icon);
Expand Down Expand Up @@ -305,7 +303,6 @@ const showTooltip = ref(false);
margin-left: -5px;
border-color: black transparent transparent transparent;
}

}
.mapcontainer {
position: relative;
Expand Down

0 comments on commit 7db0ee6

Please sign in to comment.