Skip to content

Commit

Permalink
Merge pull request #1 from nekomeowww/neko-dev
Browse files Browse the repository at this point in the history
Update from neko-dev branch
  • Loading branch information
nekomeowww authored Jun 29, 2020
2 parents a46e6e2 + 67dd78f commit f54766d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<b-modal :active.sync="isInviteDialogActive" has-modal-card>
<invite-modal></invite-modal>
</b-modal>
<router-link v-if="modulesConfig[contractType].map" class="nav-item" to="/">{{$t('map')}}</router-link>
<router-link v-if="modulesConfig[contractType].map" class="nav-item" to="/map">{{$t('map')}}</router-link>
<router-link v-if="modulesConfig[contractType].map" class="nav-item" to="/globe">{{$t('globe')}}</router-link>
<a v-if="modulesConfig[contractType].token" class="nav-item" @click="tokenShow=!tokenShow">{{$t('token_view')}}</a>
<a class="nav-item" @click="aboutShow=!aboutShow">{{$t('about_view')}}</a>
Expand Down
16 changes: 8 additions & 8 deletions src/components/Loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ export default {
@-webkit-keyframes sk-cubeGridScaleDelay
0%,100%,70%
-webkit-transform: scale3D(1,1,1)
transform: scale3D(1,1,1)
-webkit-transform: scale(1, 1)
transform: scale(1, 1)
35%
-webkit-transform: scale3D(0,0,1)
transform: scale3D(0,0,1)
-webkit-transform: scale(0, 0)
transform: scale(0, 0)
@keyframes sk-cubeGridScaleDelay
0%,100%,70%
-webkit-transform: scale3D(1,1,1)
transform: scale3D(1,1,1)
-webkit-transform: scale(1, 1)
transform: scale(1, 1)
35%
-webkit-transform: scale3D(0,0,1)
transform: scale3D(0,0,1)
-webkit-transform: scale(0, 0)
transform: scale(0, 0)
</style>

104 changes: 52 additions & 52 deletions src/views/MapView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<EnlargeImg :url="enlargeImgUrl" :isShow="enlargeImgIsShow" @close="enlargeImg" />
<Loading v-if="!mapLoad" loadText="loading ..." />
<mapbox
access-token="null"
access-token="Wk5LRwC4fuZwd18puNTd"
:map-options="{
// style: 'https://api.maptiler.com/c/adbc36eb-6765-4278-8c1a-b14fa25d0ae2/styles/basic-dark/style.json?key=eT7rAVG6glnuTf9iWHbK',
style: 'https://api.maptiler.com/maps/3a48940f-119f-4d5e-bf4b-e9b1ff19167b/style.json?key=Wk5LRwC4fuZwd18puNTd',
zoom: 11,
center: [116.478515, 39.889992],
}"
Expand Down Expand Up @@ -129,9 +129,9 @@ export default {
})
})
},
updateLocation () {
location.updateLocation()
},
// updateLocation () {
// location.updateLocation()
// },
onMapInit(map) {
// 初始化地图
map.resize();
Expand Down Expand Up @@ -161,57 +161,57 @@ export default {
Global.$emit('onLoadMap')
// 渲染地标
// this.popupComponent.$on('redeemCodeGenerated', (code) => {
// this.$modal.open({
// parent: this,
// component: RedeemCodeCopyDialog,
// hasModalCard: true,
// props: {
// code,
// },
// });
// });
this.popupComponent.$on('redeemCodeGenerated', (code) => {
this.$modal.open({
parent: this,
component: RedeemCodeCopyDialog,
hasModalCard: true,
props: {
code,
},
});
});
// if ('geolocation' in navigator) {
// this.locationUpdateTimer = setInterval(() => this.updateLocation(), 5000);
// this.updateLocation();
// }
if ('geolocation' in navigator) {
this.locationUpdateTimer = setInterval(() => this.updateLocation(), 5000);
this.updateLocation();
}
},
// updateCheckInAvailability(lonLat) {
// if (!lonLat) {
// return;
// }
// if (!this.popupComponent) {
// return;
// }
// const distance = geolib.getDistance(
// { latitude: this.meetupLocation[1], longitude: this.meetupLocation[0] },
// { latitude: lonLat[1], longitude: lonLat[0] },
// );
// // 计算活动于用户的位置
// this.popupComponent.setCanCheckIn(distance <= 1000);
// },
// updateLocation(fly = false) {
// navigator.geolocation.getCurrentPosition((position) => {
// const coord = [position.coords.longitude, position.coords.latitude];
// this.updateCheckInAvailability(coord);
// if (fly) {
// this.map.flyTo({ center: coord, zoom: 13 });
// this.jumped = true;
// this.getLocation(coord);
// } else if (!this.jumped) {
// // Jump
// this.map.jumpTo({ center: coord });
// this.jumped = true;
// }
// this.updateMyLocation();
updateCheckInAvailability(lonLat) {
if (!lonLat) {
return;
}
if (!this.popupComponent) {
return;
}
const distance = geolib.getDistance(
{ latitude: this.meetupLocation[1], longitude: this.meetupLocation[0] },
{ latitude: lonLat[1], longitude: lonLat[0] },
);
// 计算活动于用户的位置
this.popupComponent.setCanCheckIn(distance <= 1000);
},
updateLocation(fly = false) {
navigator.geolocation.getCurrentPosition((position) => {
const coord = [position.coords.longitude, position.coords.latitude];
this.updateCheckInAvailability(coord);
if (fly) {
this.map.flyTo({ center: coord, zoom: 13 });
this.jumped = true;
this.getLocation(coord);
} else if (!this.jumped) {
// Jump
this.map.jumpTo({ center: coord });
this.jumped = true;
}
this.updateMyLocation();
// if (!this.locationArr) {
// this.getLocation(coord);
// }
// });
// },
if (!this.locationArr) {
this.getLocation(coord);
}
});
},
},
destroyed() {
Expand Down

0 comments on commit f54766d

Please sign in to comment.