|
@@ -99,29 +99,29 @@ const isStandard = ref(true);
|
|
|
watchEffect(() => {
|
|
|
if (sdkLoaded.value) {
|
|
|
const checkUrl = `https://www.google.com/maps/vt/pb=!1m5!1m4!1i11!2i3339!3i1787!4i128!2m2!1e1!3i998!3m9!2szh-CN!3s!5e1105!12m1!1e4!12m1!1e47!12m1!1e3!4e0!5m1!1e0!23i1368782!23i1368785!23i4861626!23i10211310!23i4897086!23i47054629!23i72385654!23i72458815!23i10211069!23i94243289!23i94255677!23i10210500!23i94222679!23i72860224!23i10211515!23i94260020`;
|
|
|
- Promise.race([
|
|
|
- new Promise((_, reject) => {
|
|
|
- if (params.ga === "true") {
|
|
|
- reject("ga版本");
|
|
|
- }
|
|
|
- }),
|
|
|
- fetch(checkUrl).then((res) => {
|
|
|
- if (res.status !== 200) {
|
|
|
- throw "谷歌访问不了";
|
|
|
- } else {
|
|
|
- return res.status;
|
|
|
- }
|
|
|
- }),
|
|
|
- new Promise((r, j) => setTimeout(j, 3000)),
|
|
|
- ])
|
|
|
- .then(() => {
|
|
|
- console.error("使用gmap");
|
|
|
- sdk.switchMapType(isStandard.value ? "satellite" : "standard", "gmap");
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- console.error("使用amap");
|
|
|
- sdk.switchMapType(isStandard.value ? "satellite" : "standard", "amap");
|
|
|
- });
|
|
|
+ // Promise.race([
|
|
|
+ // new Promise((_, reject) => {
|
|
|
+ // if (params.ga === "true") {
|
|
|
+ // reject("ga版本");
|
|
|
+ // }
|
|
|
+ // }),
|
|
|
+ // fetch(checkUrl).then((res) => {
|
|
|
+ // if (res.status !== 200) {
|
|
|
+ // throw "谷歌访问不了";
|
|
|
+ // } else {
|
|
|
+ // return res.status;
|
|
|
+ // }
|
|
|
+ // }),
|
|
|
+ // new Promise((r, j) => setTimeout(j, 3000)),
|
|
|
+ // ])
|
|
|
+ // .then(() => {
|
|
|
+ // console.error("使用gmap");
|
|
|
+ // sdk.switchMapType(isStandard.value ? "satellite" : "standard", "gmap");
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // console.error("使用amap");
|
|
|
+ // sdk.switchMapType(isStandard.value ? "satellite" : "standard", "amap");
|
|
|
+ // });
|
|
|
}
|
|
|
});
|
|
|
|