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
68aac287
Commit
68aac287
authored
Aug 18, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改JS
配合JS添加 搜索地址返回到地图上标记功能已完成
parent
5cdb56e9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
44 deletions
+57
-44
jd.png
app/src/main/assets/web/common/jd.png
+0
-0
n2.png
app/src/main/assets/web/common/n2.png
+0
-0
zsmap.js
app/src/main/assets/web/zhs/zsmap.js
+51
-37
zsmap.html
app/src/main/assets/web/zsmap.html
+1
-4
InitMapBean.kt
app/src/main/java/com/mints/street/bean/InitMapBean.kt
+1
-0
GoogleMapFragment.kt
...java/com/mints/street/main/googlemap/GoogleMapFragment.kt
+4
-3
No files found.
app/src/main/assets/web/common/jd.png
0 → 100644
View file @
68aac287
779 Bytes
app/src/main/assets/web/common/n2.png
0 → 100644
View file @
68aac287
560 Bytes
app/src/main/assets/web/zhs/zsmap.js
View file @
68aac287
...
...
@@ -40,9 +40,11 @@ var vm = new Vue({
markes
:
[],
pxValue
:
50
,
gdcenter
:
null
,
vipLevel
:
11
,
notVipLevels
:
[
1
,
11
,
14
]
vipLevel
:
14
,
notVipLevels
:
[
1
,
11
,
14
],
nowP
:
null
,
nowS
:
null
,
iconType
:
0
,
},
created
:
function
()
{
// console.log('llll')
...
...
@@ -113,7 +115,7 @@ var vm = new Vue({
// animation: google.maps.Animation.DROP,
optimized
:
true
,
// collisionBehavior: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY',
// collisionBehavior: 'OPTIONAL_AND_HIDES_LOWER_PRIORITY',
map
:
G_MAP
,
label
:
{
text
:
msg
.
name
,
...
...
@@ -127,10 +129,10 @@ var vm = new Vue({
title
:
msg
.
bvid
,
})
marker
.
addListener
(
"click"
,
(
ss
)
=>
{
if
(
this
.
isVip
==
false
)
{
this
.
needPay
(
'p'
);
return
;
}
//
if (this.isVip == false) {
//
this.needPay('p');
//
return;
//
}
params
=
vm
.
getSeLabel
(
marker
.
getTitle
());
if
(
params
!=
null
)
{
// console.log(params);
...
...
@@ -161,11 +163,13 @@ var vm = new Vue({
th
.
showScenics
=
inMsg
.
showScenics
==
1
;
th
.
scenics
=
inMsg
.
scenics
;
th
.
isVip
=
inMsg
.
vip
==
1
;
th
.
initZsMap
(
inMsg
,
true
);
th
.
iconType
=
0
;
th
.
initZsMap
(
inMsg
);
},
initZsMap
:
function
(
inMsg
,
init
)
{
initZsMap
:
function
(
inMsg
)
{
var
th
=
this
;
th
.
isVip
=
inMsg
.
vip
==
1
;
th
.
iconType
=
inMsg
.
iconType
==
null
?
0
:
inMsg
.
iconType
;
if
(
inMsg
.
lat
==
0
||
inMsg
.
lng
==
0
||
inMsg
.
lat
==
'0'
||
inMsg
.
lng
==
'0'
)
{
...
...
@@ -179,18 +183,17 @@ var vm = new Vue({
if
(
inMsg
.
inner
==
null
)
{
toGPoint
(
point
,
function
(
r
)
{
console
.
log
(
"定位 》》》toGooglePoint"
,
r
)
th
.
G_initMap
(
r
,
th
.
getLevel
()
,
init
);
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
,
th
.
getLevel
()
,
init
);
th
.
G_initMap
(
r
,
th
.
getLevel
());
})
}
else
{
console
.
log
(
"国外 》》》toGooglePoint"
,
point
)
th
.
G_initMap
(
point
,
th
.
getLevel
(),
init
);
th
.
G_initMap
(
point
,
th
.
getLevel
());
}
}
...
...
@@ -240,16 +243,16 @@ var vm = new Vue({
return
;
}
},
needPay
:
function
(
d
)
{
needPay
:
function
(
d
)
{
console
.
log
(
"<<请开启会员"
)
if
(
d
!=
undefined
&&
d
!=
null
&&
d
==
'p'
)
{
if
(
d
!=
undefined
&&
d
!=
null
&&
d
==
'p'
)
{
needPay
();
return
;
}
needPayPopup
();
},
G_initMap
:
function
(
point
,
zoomLevel
,
init
)
{
G_initMap
:
function
(
point
,
zoomLevel
)
{
if
(
zoomLevel
==
undefined
||
zoomLevel
==
null
)
zoomLevel
=
15
;
var
th
=
this
;
...
...
@@ -307,27 +310,10 @@ var vm = new Vue({
},
false
);
if
(
init
)
{
//初始化
new
google
.
maps
.
Marker
({
position
:
point
,
map
:
G_MAP
,
icon
:
"./common/n.png"
,
//msg.img,
// animation: google.maps.Animation.DROP,
optimized
:
true
,
map
:
G_MAP
,
// label: {
// text: "i am here",
// className: "zsmaker",
// // fontFamily: "Material Icons",
// color: "#ffffff",
// fontSize: "13px",
// fontWeight: '500'
// },
});
if
(
vm
.
showScenics
)
vm
.
doShowScenics
();
vm
.
setNowO
(
point
);
}
if
(
vm
.
showScenics
)
vm
.
doShowScenics
();
}
...
...
@@ -335,8 +321,36 @@ var vm = new Vue({
}
else
{
G_MAP
.
panTo
(
point
)
//第二次初始化
G_MAP
.
setZoom
(
zoomLevel
)
vm
.
setNowO
(
point
);
}
},
setNowO
:
function
(
point
)
{
if
(
this
.
iconType
==
0
)
{
if
(
this
.
nowP
==
null
)
{
this
.
nowP
=
new
google
.
maps
.
Marker
({
position
:
point
,
map
:
G_MAP
,
icon
:
"./common/n2.png"
,
//msg.img,
optimized
:
true
,
map
:
G_MAP
,
});
}
else
{
this
.
nowP
.
setPosition
(
point
)
}
}
else
{
if
(
this
.
nowS
==
null
)
{
this
.
nowS
=
new
google
.
maps
.
Marker
({
position
:
point
,
map
:
G_MAP
,
icon
:
"./common/jd.png"
,
//msg.img,
optimized
:
true
,
map
:
G_MAP
,
});
}
else
{
this
.
nowS
.
setPosition
(
point
)
}
}
}
}
})
...
...
app/src/main/assets/web/zsmap.html
View file @
68aac287
...
...
@@ -129,8 +129,5 @@
<script
type=
"text/javascript"
charset=
"UTF-8"
src=
"./zsmap_files/onion.js"
></script>
<script
type=
"text/javascript"
charset=
"UTF-8"
src=
"./zsmap_files/controls.js"
></script>
<script
src=
"./zsmap_files/js"
async=
""
></script>
<script
src=
"./common/vconsole.min.js"
></script>
<script>
var
vConsole
=
new
VConsole
();
</script>
</html>
app/src/main/java/com/mints/street/bean/InitMapBean.kt
View file @
68aac287
...
...
@@ -8,6 +8,7 @@ class InitMapBean {
var
lng
:
Double
=
0.0
var
vip
:
Int
?
=
0
//0 非vip 1 vip
var
inner
:
Int
?
=
0
// 0国内 ,1国外
var
iconType
:
Int
?
=
0
// 定位icon还是搜索之后的icon 0国内 ,1国外
var
mapType
:
String
?=
null
//当前地图类型
var
showVrButton
:
Int
?
=
0
//是否展示街景按钮 1 展示,0 不展示
var
showScenics
:
Int
?
=
0
//是否展示景点推荐 1 展示 ,0 不展示
...
...
app/src/main/java/com/mints/street/main/googlemap/GoogleMapFragment.kt
View file @
68aac287
...
...
@@ -127,7 +127,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
//点击调转页面
viewModel
.
authorized
(
bvid
,
name
)
//更新当前坐标(控制js页面做回调)
loadPosition
(
lat
?.
toDouble
(),
lng
?.
toDouble
())
loadPosition
(
lat
?.
toDouble
(),
lng
?.
toDouble
()
,
iconType
=
1
)
}
}
}).
init
().
show
()
...
...
@@ -243,7 +243,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
* 调用JS
* 定位
*/
private
fun
loadPosition
(
lat
:
Double
?
=
null
,
lng
:
Double
?
=
null
,
inner
:
Int
=
0
)
{
private
fun
loadPosition
(
lat
:
Double
?
=
null
,
lng
:
Double
?
=
null
,
inner
:
Int
=
0
,
iconType
:
Int
=
0
)
{
val
initMapBean
=
InitMapBean
()
initMapBean
.
lat
=
lat
?:
gps
.
lat
initMapBean
.
lng
=
lng
?:
gps
.
lng
...
...
@@ -256,6 +256,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}
initMapBean
.
inner
=
inner
initMapBean
.
iconType
=
iconType
binding
.
webview
.
callHandler
(
"initZsMap"
,
Gson
().
toJson
(
initMapBean
)
)
{
...
...
@@ -433,7 +434,7 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
})
//搜索页面回调参数
viewModel
.
pt
.
observe
(
this
,
Observer
{
loadPosition
(
it
.
lat
,
it
.
lng
,
it
.
inner
)
loadPosition
(
it
.
lat
,
it
.
lng
,
it
.
inner
,
1
)
binding
.
scrollLayout
.
toggle
(
ScrollLayout
.
STATUS_CLOSE
)
})
//获取地图展示样式
...
...
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