Bläddra i källkod

Added provinces to map

master
Kobus 5 år sedan
förälder
incheckning
4a7cbef427
1 ändrade filer med 22 tillägg och 5 borttagningar
  1. 22
    5
      src/components/timeshare/buy/buyPage.vue

+ 22
- 5
src/components/timeshare/buy/buyPage.vue Visa fil

46
                 :aria-controls="'collapse' + region.id"
46
                 :aria-controls="'collapse' + region.id"
47
               >
47
               >
48
                 <div :id="'header' + region.id">
48
                 <div :id="'header' + region.id">
49
-                  <h5 class="mb-0">{{ region.regionName }}</h5>
49
+                  <h5
50
+                    class="mb-0"
51
+                    @mouseover="updateMapProvince(region.regionName)"
52
+                  >{{ region.regionName }}</h5>
50
                 </div>
53
                 </div>
51
               </a>
54
               </a>
52
               <div
55
               <div
61
                       class="cursor-pointer"
64
                       class="cursor-pointer"
62
                       href="#"
65
                       href="#"
63
                       @click="routerGoTo('/resort/' + resort.resortCode)"
66
                       @click="routerGoTo('/resort/' + resort.resortCode)"
64
-                      @mouseover="getResort(resort.resortCode)"
67
+                      @mouseover="updateMap(resort.resortCode)"
65
                     >{{resort.resortName}}</a>
68
                     >{{resort.resortName}}</a>
66
                     <br />
69
                     <br />
67
                   </p>
70
                   </p>
115
 
118
 
116
 export default {
119
 export default {
117
   name: 'TimeshareToBuy',
120
   name: 'TimeshareToBuy',
121
+  data() {
122
+    return {
123
+      myMap: 'SouthAfrica',
124
+      myZoom: 5,
125
+    };
126
+  },
118
   mounted() {
127
   mounted() {
119
     this.getRegions();
128
     this.getRegions();
120
   },
129
   },
121
   computed: {
130
   computed: {
122
     ...mapState('timeshareBuy', ['detailedRegion', 'resort']),
131
     ...mapState('timeshareBuy', ['detailedRegion', 'resort']),
123
     mapUrl() {
132
     mapUrl() {
124
-      return `http://maps.google.com/maps?q=${this.resort.prLatitude},${this.resort.prLongitude}&z=15&output=embed`;
133
+      // return 'http://maps.google.com/maps/place/Gauteng/';
134
+      return `http://maps.google.com/maps?q=${this.myMap}&z=${this.myZoom}&output=embed`;
125
     },
135
     },
126
     regions() {
136
     regions() {
127
       return _.sortBy(this.detailedRegion, r => r.regionName);
137
       return _.sortBy(this.detailedRegion, r => r.regionName);
133
       this.$router.push(goTo);
143
       this.$router.push(goTo);
134
     },
144
     },
135
     updateMap(resortCode) {
145
     updateMap(resortCode) {
136
-      this.getGPS(resortCode);
137
-      alert(resortCode);
146
+      this.myMap = 'SouthAfrice';
147
+      this.getResort(resortCode);
148
+      // `http://maps.google.com/maps?q=${this.resort.prLatitude},${this.resort.prLongitude}&z=7&output=embed`;
149
+      this.myMap = `${this.resort.prLatitude},${this.resort.prLongitude}`;
150
+      this.myZoom = 10;
151
+    },
152
+    updateMapProvince(province) {
153
+      this.myMap = province.replace(/\s/g, '');
154
+      this.myZoom = 7;
138
     },
155
     },
139
   },
156
   },
140
 };
157
 };

Laddar…
Avbryt
Spara