Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
html
/
MeteorologicalBureau
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8339909c
authored
Mar 11, 2020
by
hank
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of gitlab.maxrocky.com:hanjixin/MeteorologicalBureau into develop
parents
fca58595
5bacae97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
map/index.html
+4
-1
map/js/Map3D.js
+29
-3
No files found.
map/index.html
View file @
8339909c
...
@@ -57,7 +57,10 @@
...
@@ -57,7 +57,10 @@
window
.
delPoi
()
window
.
delPoi
()
window
.
review
()
window
.
review
()
$
.
getJSON
(
api
).
then
(
res
=>
{
$
.
getJSON
(
api
).
then
(
res
=>
{
var
currentDetailList
=
JSON
.
parse
(
res
).
currentDetailList
var
currentDetailList
=
JSON
.
parse
(
res
).
currentDetailList
.
slice
(
0
,
2000
);
console
.
log
(
currentDetailList
);
console
.
log
(
currentDetailList
);
if
(
type
==
'MassMarks'
){
if
(
type
==
'MassMarks'
){
window
.
pois
=
map3d
.
addPoisMassMarks
(
currentDetailList
)
window
.
pois
=
map3d
.
addPoisMassMarks
(
currentDetailList
)
...
...
map/js/Map3D.js
View file @
8339909c
import
{
bounds2Path
,
MaskLayer
}
from
"./tools.js"
import
{
bounds2Path
,
MaskLayer
}
from
"./tools.js"
var
_renderClusterMarker
=
function
(
context
)
{
var
factor
=
Math
.
pow
(
context
.
count
/
count
,
1
/
18
);
var
div
=
document
.
createElement
(
'div'
);
var
Hue
=
180
-
factor
*
180
;
var
bgColor
=
'hsla('
+
Hue
+
',100%,50%,0.7)'
;
var
fontColor
=
'hsla('
+
Hue
+
',100%,20%,1)'
;
var
borderColor
=
'hsla('
+
Hue
+
',100%,40%,1)'
;
var
shadowColor
=
'hsla('
+
Hue
+
',100%,50%,1)'
;
div
.
style
.
backgroundColor
=
bgColor
;
var
size
=
Math
.
round
(
30
+
Math
.
pow
(
context
.
count
/
count
,
1
/
5
)
*
20
);
div
.
style
.
width
=
div
.
style
.
height
=
size
+
'px'
;
div
.
style
.
border
=
'solid 1px '
+
borderColor
;
div
.
style
.
borderRadius
=
size
/
2
+
'px'
;
div
.
style
.
boxShadow
=
'0 0 1px '
+
shadowColor
;
div
.
innerHTML
=
context
.
count
;
div
.
style
.
lineHeight
=
size
+
'px'
;
div
.
style
.
color
=
fontColor
;
div
.
style
.
fontSize
=
'14px'
;
div
.
style
.
textAlign
=
'center'
;
context
.
marker
.
setOffset
(
new
AMap
.
Pixel
(
-
size
/
2
,
-
size
/
2
));
context
.
marker
.
setContent
(
div
)
};
class
Map3D
{
class
Map3D
{
constructor
(
cityCode
,
domId
,
params
,
cb
)
{
constructor
(
cityCode
,
domId
,
params
,
cb
)
{
let
opts
=
{
let
opts
=
{
...
@@ -46,7 +67,12 @@ class Map3D {
...
@@ -46,7 +67,12 @@ class Map3D {
if
(
this
.
cluster
){
if
(
this
.
cluster
){
this
.
cluster
.
addMarkers
(
markers
)
this
.
cluster
.
addMarkers
(
markers
)
}
else
{
}
else
{
this
.
cluster
=
new
AMap
.
MarkerClusterer
(
this
.
map
,
markers
,
{
gridSize
:
80
});
this
.
cluster
=
new
AMap
.
MarkerClusterer
(
this
.
map
,
markers
,
{
gridSize
:
80
,
renderClusterMarker
:
function
(
context
)
{
// _renderClusterMarker(context,markers.length);
}
});
}
}
return
markers
return
markers
}
}
...
@@ -91,7 +117,7 @@ class Map3D {
...
@@ -91,7 +117,7 @@ class Map3D {
let
marker
=
new
AMap
.
Marker
({
let
marker
=
new
AMap
.
Marker
({
map
:
this
.
map
,
map
:
this
.
map
,
position
:
new
AMap
.
LngLat
(
Number
(
item
.
lon
),
Number
(
item
.
lat
)),
//基点位置
position
:
new
AMap
.
LngLat
(
Number
(
item
.
lon
),
Number
(
item
.
lat
)),
//基点位置
icon
:
'https://a.amap.com/jsapi_demos/static/images/darkRed
.png'
,
//marker图标,直接传递地址url
icon
:
'img/1
.png'
,
//marker图标,直接传递地址url
offset
:
{
x
:
-
8
,
y
:
-
34
}
//相对于基点的位置
offset
:
{
x
:
-
8
,
y
:
-
34
}
//相对于基点的位置
});
});
return
marker
return
marker
...
...
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