Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Dashboards
Tabler
提交
665c106b
T
Tabler
项目概览
Dashboards
/
Tabler
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tabler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
665c106b
编写于
2月 20, 2020
作者:
C
codecalm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mapbox small fixes
上级
c25b2593
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
6 deletion
+36
-6
pages/_data/maps.yml
pages/_data/maps.yml
+23
-2
pages/_includes/ui/map.html
pages/_includes/ui/map.html
+12
-3
pages/maps.html
pages/maps.html
+1
-1
未找到文件。
pages/_data/maps.yml
浏览文件 @
665c106b
...
...
@@ -7,9 +7,30 @@ light:
zoom
:
11
style
:
light-v10
card
:
markers
:
title
:
Light map style
center
:
[
0
,
0
]
zoom
:
1
style
:
light-v10
card
:
true
markers
:
-
name
:
Buenos Aires
center
:
[
-34.58333333
,
-58.666667
]
-
name
:
Vienna
center
:
[
48.2
,
16.366667
]
-
name
:
Beijing
center
:
[
39.91666667
,
116.383333
]
-
name
:
Canberra
center
:
[
-35.26666667
,
149.133333
]
-
name
:
Muscat
center
:
[
23.61666667
,
58.583333
]
-
name
:
Washington
center
:
[
38.883333
,
-77
]
card
:
title
:
Full-card map
center
:
[
0
,
0
]
zoom
:
1
style
:
satellite-v9
card
:
true
\ No newline at end of file
card
:
true
pages/_includes/ui/map.html
浏览文件 @
665c106b
...
...
@@ -4,7 +4,7 @@
{% if data %}
<div
class=
"embed-responsive embed-responsive-{{ data.ratio | default: include.ratio | default: '16by9' }}"
>
<div
class=
"embed-responsive-item"
>
<div
id=
"map-{{ id }}"
class=
"w-100 h-100"
></div>
<div
id=
"map-{{ id }}"
class=
"w-100 h-100
{% if data.card %} rounded{% endif %}
"
></div>
</div>
</div>
...
...
@@ -12,6 +12,8 @@
{% capture_global scripts %}
<script>
// @formatter:off
{
%
if
jekyll
.
environment
==
'
development
'
%
}
window
.
tabler_map
=
window
.
tabler_map
||
{};{
%
endif
%
}
document
.
addEventListener
(
"
DOMContentLoaded
"
,
function
()
{
mapboxgl
.
accessToken
=
'
{{ site.mapbox_key }}
'
;
var
map
=
new
mapboxgl
.
Map
({
...
...
@@ -19,11 +21,18 @@
style
:
'
mapbox://styles/mapbox/{{ data.style | default: "streets-v11" }}
'
,
zoom
:
{{
data
.
zoom
|
default
:
13
}},
{
%
if
data
.
center
%
}
center
:
[{{
data
.
center
[
1
]
}},
{{
data
.
center
[
0
]
}}],
center
:
[{{
data
.
center
[
1
]
}},
{{
data
.
center
[
0
]
}}],
{
%
else
%
}
center
:
[
13.404900
,
52.518827
],
center
:
[
13.404900
,
52.518827
],
{
%
endif
%
}
});
{
%
for
marker
in
data
.
markers
%
}
new
mapboxgl
.
Marker
({
color
:
"
{{ 'blue' | tabler_color }}
"
}).
setLngLat
([{{
marker
.
center
[
1
]
}},
{{
marker
.
center
[
0
]
}}]).
addTo
(
map
);
{
%
endfor
%
}
{
%
if
jekyll
.
environment
==
'
development
'
%
}
window
.
tabler_map
[
"
map-{{ map-id }}
"
]
=
map
;{
%
endif
%
}
});
// @formatter:on
</script>
...
...
pages/maps.html
浏览文件 @
665c106b
...
...
@@ -10,7 +10,7 @@ menu: base.maps
{% if map[1].card %}
<div
class=
"col-lg-12"
>
<div
class=
"card"
>
{% include ui/map.html map-id=map-id ratio="
16by9
" %}
{% include ui/map.html map-id=map-id ratio="
2by1
" %}
</div>
</div>
{% else %}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录