Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_street
Commits
4d37bd73
Commit
4d37bd73
authored
Aug 16, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改JS(z3map)
parent
044c435b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
160 additions
and
111 deletions
+160
-111
ap.js
app/src/main/assets/web/common/ap.js
+15
-0
zsmap.js
app/src/main/assets/web/zsmap.js
+145
-111
No files found.
app/src/main/assets/web/common/ap.js
View file @
4d37bd73
...
...
@@ -105,6 +105,15 @@ function centerChanged() {
}
}
function
needPay
()
{
try
{
doAppFun
(
"needPay"
);
}
catch
(
e
)
{
// console.log("tips", msg)
//alert("app未弹框==>" + msg + e)
}
}
function
tips
(
msg
)
{
try
{
doAppFun
(
"tips"
,
msg
);
...
...
@@ -197,6 +206,12 @@ connectWebViewJavascriptBridge(function (bridge) {
responseCallback
(
getVmMsg
(
"suc:changeMapType"
));
});
bridge
.
registerHandler
(
"changeToVip"
,
function
(
data
,
responseCallback
)
{
vm
.
changeToVip
();
responseCallback
(
getVmMsg
(
"suc:changeToVip"
));
});
})
...
...
app/src/main/assets/web/zsmap.js
View file @
4d37bd73
...
...
@@ -20,30 +20,11 @@
let
G_MAP
;
//gmap
function
GF_addZoom
()
{
var
zoom
=
G_MAP
.
getZoom
();
if
(
zoom
==
20
)
{
tip
(
"已放大至最大级别"
)
return
;
}
zoom
+=
1
;
G_MAP
.
setZoom
(
zoom
);
}
function
GF_reduceZoom
()
{
var
zoom
=
G_MAP
.
getZoom
();
if
(
zoom
==
0
)
{
tip
(
"已缩放至最小级别"
)
return
;
}
zoom
-=
1
;
G_MAP
.
setZoom
(
zoom
);
}
var
vm
=
new
Vue
({
el
:
'#maps'
,
data
:
{
isVip
:
false
,
showVrButton
:
true
,
showScenics
:
false
,
mapScale
:
""
,
...
...
@@ -58,7 +39,9 @@ var vm = new Vue({
scenics
:
[],
markes
:
[],
pxValue
:
50
,
gdcenter
:
null
gdcenter
:
null
,
vipLevel
:
16
,
notVipLevels
:
[
8
,
9
,
10
]
},
created
:
function
()
{
...
...
@@ -68,7 +51,10 @@ var vm = new Vue({
vrs
:
function
()
{
var
th
=
this
;
console
.
log
(
th
.
canclick
)
if
(
this
.
isVip
==
false
){
this
.
needPay
();
return
;
}
if
(
th
.
canclick
)
{
th
.
canclick
=
false
;
setTimeout
(
function
()
{
...
...
@@ -114,8 +100,6 @@ var vm = new Vue({
vm
.
markes
[
i
].
setMap
(
G_MAP
);
}
}
// G_MAP.setZoom(10)
},
...
...
@@ -144,20 +128,26 @@ var vm = new Vue({
title
:
msg
.
bvid
,
})
marker
.
addListener
(
"click"
,
(
ss
)
=>
{
if
(
this
.
isVip
==
false
){
this
.
needPay
();
return
;
}
params
=
vm
.
getSeLabel
(
marker
.
getTitle
());
if
(
params
!=
null
)
{
console
.
log
(
params
);
openScenicsFrame
(
params
);
G_MAP
.
setCenter
({
lat
:
params
.
lat
,
lng
:
params
.
lng
lat
:
params
.
lat
,
lng
:
params
.
lng
})
}
});
vm
.
markes
.
push
(
marker
);
}
},
changeToVip
:
function
(){
this
.
isVip
=
true
;
},
getSeLabel
:
function
(
bvid
)
{
for
(
i
in
this
.
scenics
)
{
if
(
this
.
scenics
[
i
].
bvid
==
bvid
)
...
...
@@ -165,22 +155,15 @@ var vm = new Vue({
}
return
null
;
},
addZoom
:
function
()
{
GF_addZoom
();
},
reduceZoom
:
function
()
{
GF_reduceZoom
();
},
initZsMap
:
function
(
inMsg
)
{
var
th
=
this
;
if
(
inMsg
.
lat
==
0
||
inMsg
.
lng
==
0
||
inMsg
.
lat
==
'0'
||
inMsg
.
lng
==
'0'
)
{
inMsg
=
{
"lat"
:
39.90960456049752
,
"lng"
:
116.3972282409668
,
"inner"
:
0
};
inMsg
.
lat
=
39.90960456049752
;
inMsg
.
lng
=
116.3972282409668
;
}
th
.
isVip
=
inMsg
.
vip
==
1
;
var
point
=
{
lat
:
parseFloat
(
inMsg
.
lat
),
lng
:
parseFloat
(
inMsg
.
lng
)
...
...
@@ -188,23 +171,71 @@ var vm = new Vue({
if
(
inMsg
.
inner
==
null
)
{
toGPoint
(
point
,
function
(
r
)
{
console
.
log
(
"定位 》》》toGooglePoint"
,
r
)
th
.
G_initMap
(
r
,
16
);
th
.
G_initMap
(
r
,
th
.
getLevel
()
);
})
}
else
{
if
(
inMsg
.
inner
==
0
||
inMsg
==
'0'
)
{
toGPoint
(
point
,
function
(
r
)
{
console
.
log
(
"国内 》》》toGooglePoint"
,
r
)
th
.
G_initMap
(
r
,
16
);
th
.
G_initMap
(
r
,
th
.
getLevel
()
);
})
}
else
{
console
.
log
(
"国外 》》》toGooglePoint"
,
point
)
th
.
G_initMap
(
point
,
16
);
th
.
G_initMap
(
point
,
th
.
getLevel
()
);
}
}
},
getLevel
:
function
()
{
if
(
this
.
isVip
)
return
this
.
vipLevel
;
return
this
.
notVipLevels
[
1
];
},
addZoom
:
function
()
{
var
zoom
=
G_MAP
.
getZoom
();
if
(
zoom
==
20
)
{
tip
(
"已放大至最大级别"
)
return
;
}
zoom
+=
1
;
vm
.
checkZoom
(
zoom
);
G_MAP
.
setZoom
(
zoom
);
},
reduceZoom
:
function
()
{
var
zoom
=
G_MAP
.
getZoom
();
if
(
zoom
==
0
)
{
tip
(
"已缩放至最小级别"
)
return
;
}
zoom
-=
1
;
vm
.
checkZoom
(
zoom
);
G_MAP
.
setZoom
(
zoom
);
},
checkZoom
:
function
(
zoom
)
{
if
(
zoom
==
undefined
||
zoom
==
null
)
zoom
=
G_MAP
.
getZoom
();
console
.
log
(
zoom
)
if
(
zoom
<
vm
.
notVipLevels
[
0
])
{
G_MAP
.
setZoom
(
vm
.
notVipLevels
[
0
]);
this
.
needPay
();
return
;
}
if
(
zoom
>
vm
.
notVipLevels
[
2
])
{
G_MAP
.
setZoom
(
vm
.
notVipLevels
[
2
]);
this
.
needPay
();
return
;
}
},
needPay
:
function
(){
console
.
log
(
"<<请开启会员"
)
needPay
();
},
G_initMap
:
function
(
point
,
zoomLevel
)
{
if
(
zoomLevel
==
undefined
||
zoomLevel
==
null
)
zoomLevel
=
15
;
...
...
@@ -244,8 +275,13 @@ var vm = new Vue({
var
lat
=
G_MAP
.
getCenter
().
lat
();
var
zoomLevel
=
G_MAP
.
getZoom
();
vm
.
mapScale
=
getScaleInfos
(
zoomLevel
,
lat
,
vm
);
});
if
(
vm
.
isVip
)
return
;
vm
.
checkZoom
();
});
G_MAP
.
addListener
(
"dragend"
,
()
=>
{
...
...
@@ -267,9 +303,7 @@ var vm = new Vue({
// }
// }, false);
// G_MAP.addListener('zoom_changed', () => {
// console.log(G_MAP.getCenter().lat())
// });
}
window
.
google
.
maps
.
Load
&&
window
.
google
.
maps
.
Load
(
G_ZSYDA
);
}
else
{
...
...
@@ -283,75 +317,75 @@ var vm = new Vue({
window
.
onload
=
function
()
{
allIsOk
();
//
init();
//
init();
}
function
init
()
{
vm
.
initZsMap
({
"lng"
:
0
,
"lat"
:
0
})
//
//
setTimeout(function () {
//
vm.doShowScenics([
//
{
//
"name": "故宫",
//
"img": "https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_camera/img/ui/homepage/1628578695759.jpeg",
//
"desc": "北京故宫呀",
//
"lng": "116.313355",
//
"lat": "39.983856",
//
"blng": "116.32222419295384",
//
"blat": "39.99602192441332",
//
"bvid": "01002200001309200841046795L"
//
}
//
]);
//
}, 3000)
//
//
setTimeout(function () {
//
vm.showVrButton = true;
//
}, 5000)
//
//
setTimeout(function () {
//
vm.showVrButton = false;
//
}, 7000)
//
//
setTimeout(function () {
//
vm.showVrButton = true;
//
}, 8000)
//
//
setTimeout(function () {
//
vm.doCloseScenics();
//
}, 6000)
//
//
setTimeout(function () {
//
G_MAP.setMapTypeId('roadmap');
//
//
}, 7000)
//
setTimeout(function () {
//
G_MAP.setMapTypeId('terrain');
//
//
}, 11000)
//
//
setTimeout(function () {
//
G_MAP.setMapTypeId('satellite');
//
//
}, 13000)
//
setTimeout(function () {
//
G_MAP.setMapTypeId('hybrid');
//
//
}, 15000)
//
//
setTimeout(function () {
//
vm.doShowScenics([
//
{
//
"name": "故宫",
//
"img": "https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_camera/img/ui/homepage/1628578695759.jpeg",
//
"desc": "北京故宫呀",
//
"lng": "116.313355",
//
"lat": "39.983856",
//
"blng": "116.32222419295384",
//
"blat": "39.99602192441332",
//
"bvid": "01002200001309200841046795L"
//
}
//
]);
//
}, 9000)
vm
.
initZsMap
({
"lng"
:
0
,
"lat"
:
0
,
"vip"
:
0
,
"inner"
:
1
})
setTimeout
(
function
()
{
vm
.
doShowScenics
([
{
"name"
:
"故宫"
,
"img"
:
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_camera/img/ui/homepage/1628578695759.jpeg"
,
"desc"
:
"北京故宫呀"
,
"lng"
:
"116.313355"
,
"lat"
:
"39.983856"
,
"blng"
:
"116.32222419295384"
,
"blat"
:
"39.99602192441332"
,
"bvid"
:
"01002200001309200841046795L"
}
]);
},
3000
)
setTimeout
(
function
()
{
vm
.
showVrButton
=
true
;
},
5000
)
setTimeout
(
function
()
{
vm
.
showVrButton
=
false
;
},
7000
)
setTimeout
(
function
()
{
vm
.
showVrButton
=
true
;
},
8000
)
setTimeout
(
function
()
{
vm
.
doCloseScenics
();
},
6000
)
setTimeout
(
function
()
{
G_MAP
.
setMapTypeId
(
'roadmap'
);
},
7000
)
setTimeout
(
function
()
{
G_MAP
.
setMapTypeId
(
'terrain'
);
},
11000
)
setTimeout
(
function
()
{
G_MAP
.
setMapTypeId
(
'satellite'
);
},
13000
)
setTimeout
(
function
()
{
G_MAP
.
setMapTypeId
(
'hybrid'
);
},
15000
)
setTimeout
(
function
()
{
vm
.
doShowScenics
([
{
"name"
:
"故宫"
,
"img"
:
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_camera/img/ui/homepage/1628578695759.jpeg"
,
"desc"
:
"北京故宫呀"
,
"lng"
:
"116.313355"
,
"lat"
:
"39.983856"
,
"blng"
:
"116.32222419295384"
,
"blat"
:
"39.99602192441332"
,
"bvid"
:
"01002200001309200841046795L"
}
]);
},
9000
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment