Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
Details
Activity
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
wangxuelai
biz.qingxiao.com
Commits
f5782dde
Commit
f5782dde
authored
Oct 17, 2019
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选点优化
parent
e8c3d503
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
25 deletions
+31
-25
SelectPlace.js
src/pages/schooledit/SelectPlace.js
+31
-25
No files found.
src/pages/schooledit/SelectPlace.js
View file @
f5782dde
...
...
@@ -84,38 +84,44 @@ class SelectPlaceMap extends React.Component {
that
.
infoArray
.
forEach
((
ele
)
=>
{
ele
.
setMap
(
null
);
});
console
.
log
(
res
,
'res'
);
showLatlng
=
new
qq
.
maps
.
LatLng
(
res
.
result
.
location
.
lat
,
res
.
result
.
location
.
lng
);
const
title
=
res
.
result
.
address_component
.
province
+
res
.
result
.
address_component
.
city
+
res
.
result
.
formatted_addresses
.
rough
;
dispatch
({
type
:
'schooladd/updateState'
,
payload
:
{
longitude
:
res
.
result
.
location
.
lng
,
latitude
:
res
.
result
.
location
.
lat
,
locationAddress
:
title
,
province
:
res
.
result
.
address_component
.
province
,
city
:
res
.
result
.
address_component
.
city
,
district
:
res
.
result
.
address_component
.
district
,
},
});
let
title
=
''
;
if
(
res
.
result
.
address_component
.
province
)
{
title
=
res
.
result
.
address_component
.
province
+
res
.
result
.
address_component
.
city
+
res
.
result
.
formatted_addresses
.
rough
;
dispatch
({
type
:
'schooladd/updateState'
,
payload
:
{
longitude
:
res
.
result
.
location
.
lng
,
latitude
:
res
.
result
.
location
.
lat
,
locationAddress
:
title
,
province
:
res
.
result
.
address_component
.
province
,
city
:
res
.
result
.
address_component
.
city
,
district
:
res
.
result
.
address_component
.
district
,
},
});
}
// message.success('已将该地址导入为机构地址,不要忘记保存哦', 2);
const
pointMarker
=
new
qq
.
maps
.
Marker
({
position
:
showLatlng
,
map
:
that
.
map
,
});
const
info
=
new
qq
.
maps
.
InfoWindow
({
map
:
that
.
map
,
content
:
title
,
position
:
showLatlng
,
zIndex
:
99
,
visible
:
true
,
});
qq
.
maps
.
event
.
addListener
(
pointMarker
,
'click'
,
()
=>
{
info
.
open
();
info
.
setContent
(
title
);
info
.
setPosition
(
showLatlng
);
});
if
(
title
!=
''
)
{
const
info
=
new
qq
.
maps
.
InfoWindow
({
map
:
that
.
map
,
content
:
title
||
''
,
position
:
showLatlng
,
zIndex
:
99
,
visible
:
true
,
});
qq
.
maps
.
event
.
addListener
(
pointMarker
,
'click'
,
()
=>
{
info
.
open
();
info
.
setContent
(
title
);
info
.
setPosition
(
showLatlng
);
});
that
.
infoArray
.
push
(
info
);
}
that
.
pointArray
.
push
(
pointMarker
);
that
.
infoArray
.
push
(
info
);
that
.
setState
({
locationList
:
[],
});
...
...
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