-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
271 lines (262 loc) · 14.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Map by shenqihui</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style/stylesheet.css" media="screen">
<link rel="stylesheet" href="bower_components/jquery-jvectormap-2.0.3/jquery-jvectormap-2.0.3.css">
<link rel="stylesheet" href="https://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css">
</head>
<body ng-app="app">
<section class="page-header">
<h1 class="project-name">Map</h1>
<h2 class="project-tagline">很方便的创建 map</h2>
<a href="https://github.com/shenqihui/map" class="btn btn-info" target="_blank">View on GitHub</a>
<a href="https://github.com/shenqihui/map/zipball/gh-pages" class="btn btn-info" target="_blank">Download .zip</a>
<a href="https://github.com/shenqihui/map/tarball/gh-pages" class="btn btn-info" target="_blank">Download .tar.gz</a>
</section>
<section class="main-content" ng-controller="map">
<h1>渲染结果</h1>
<div class="jvectormap-container" style="margin: 0 auto;border: 0; padding: 0;height: {{map.height}}px;width: {{map.width}}px">
<link rel="stylesheet" href="bower_components/jquery-jvectormap-2.0.3/jquery-jvectormap-2.0.3.css">
<style id="jvectormap">
.jvectormap-legend, .jvectormap-zoomin, .jvectormap-zoomout, .jvectormap-goback {
background: {{map.backgroundColor}};
color: {{map.color}};
border-color: {{map.color}};
border: 1px solid {{map.color}};
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
}
.jvectormap-legend-tick {
height: 21px;
}
</style>
<div data-chart="map" id="map-container" style="margin: 0 auto;border: 0; padding: 0;height: {{map.height}}px;width: {{map.width}}px"></div>
</div>
<hr>
<div>
<h1>导入导出</h1>
<div class="form-inline">
<div class="form-group">
<span ng-click="dumpSvg()" class="btn btn-info">导出 SVG</span>
</div>
<div class="form-group">
<span ng-click="dumpPng()" class="btn btn-info">导出 PNG</span>
</div>
<div class="form-group">
<span ng-click="dumpHtml()" class="btn btn-info">导出嵌套的 HTML</span>
</div>
<div class="form-group">
<span ng-click="dumpConfig()" class="btn btn-info">导出当前配置</span>
</div>
<div class="form-group">
<label for="input-config">导入配置</label>
<input id="input-config" type="file" class="form-control btn btn-info" custom-on-change="inputConfig"/>
</div>
</div>
<hr>
<h1>配置</h1>
<form class="form-inline" ng-submit="emitBuildMap()">
<div class="form-group">
<label for="map-select">地图类型:</label>
<select class="form-control" name="map-select" id="map-select" ng-model="mapType" ng-change="getAreaJs()">
<option value="merc">merc</option>
<option value="mill">mill</option>
</select>
</div>
<div class="form-group">
<label for="map-select">地区级别:</label>
<select class="form-control" name="map-select" id="map-select" ng-model="areaType" ng-change="getAreaJs()">
<option ng-repeat="(name, tree) in mapTree" value="{{name}}">{{name}}</option>
</select>
</div>
<div class="form-group">
<label for="map-select">区域:</label>
<select class="form-control" name="map-select" id="map-select" ng-model="area" ng-change="getAreaJs()">
<option ng-repeat="item in mapTree[areaType]" value="{{item.name}}" ng-init="area = item[mapType]">{{item.name}}</option>
</select>
</div>
<div class="form-group">
<span id="map-build" class="btn btn-info" type="button" ng-click="randomMapData()" ng-disabled="!mapTree[areaType][area][mapType + 'Load']"><span ng-show="mapTree[areaType][area][mapType + 'Load']">随机渲染该底图</span> <span ng-show="!mapTree[areaType][area][mapType + 'Load']">先选择底图</span></span>
</div>
<hr class="clearfix">
<div class="form-group">
<label for="map-width">地图背景颜色:</label>
<input class="form-control" type="color" name="map-backgroundColor" id="map-backgroundColor" ng-model="map.backgroundColor" ng-change="mapGetColor()"/>
</div>
<div class="form-group">
<label for="map-width">地图文字颜色:</label>
<input class="form-control" type="color" name="map-backgroundColor" id="map-backgroundColor" ng-model="map.color" readonly ng-change="emitBuildMap()"/>
<span class="help-block" style="display: inline;">(会跟随背景颜色自动计算)</span>
</div>
<div class="form-group">
<label for="map-width">地图渲染开始颜色:</label>
<input class="form-control" type="color" name="map-scaleBegin" id="map-scaleBegin" ng-model="map.scaleBegin" ng-change="emitBuildMap()"/>
</div>
<div class="form-group">
<label for="map-width">地图渲染结束颜色:</label>
<input class="form-control" type="color" name="map-scaleEnd" id="map-scaleEnd" ng-model="map.scaleEnd" ng-change="emitBuildMap()"/>
</div>
<div class="form-group" ng-if="mapExampleColors">
<label for="map-width">渲染颜色例子:</label>
<span ng-repeat="color in mapExampleColors">
<button class="btn btn-xs btn-info" ng-click="useExampleColor(color.colors)">{{color.name}}</button>
</span>
</div>
<hr class="clearfix">
<div class="form-group">
<label for="map-width">地图宽度:</label>
<div class="input-group">
<input class="form-control" type="number" name="map-width" id="map-width" ng-model="map.width" ng-change="getAreaJs()"/>
<div class="input-group-addon">px</div>
</div>
</div>
<div class="form-group">
<label for="map-height">地图高度:</label>
<div class="input-group">
<input class="form-control" type="number" name="map-height" id="map-height" ng-model="map.height" ng-change="getAreaJs()"/>
<div class="input-group-addon">px</div>
</div>
</div>
<div class="form-group">
<button id="map-build" class="btn btn-info" ng-disabled="!mapTree[areaType][area][mapType + 'Load']"><span ng-show="mapTree[areaType][area][mapType + 'Load']">渲染地图</span> <span ng-show="!mapTree[areaType][area][mapType + 'Load']">加载地图底图中</span></button>
</div>
<hr class="clearfix">
<div class="form-group" style="width: 100%;">
<label for="map-data">地图数据:</label>
<textarea class="form-control" name="map-data" id="map-data" ng-model="mapData" cols="30" rows="10" style="width: 100%;"></textarea>
</div>
</form>
</div>
<hr>
<div>
<p>例子数据:可以用下面的例子数据进行渲染地图。</p>
<ul>
<li>
<p>能渲染的地图类型(不区分 Mercator 和 Miller 类型): China <button class="btn btn-xs btn-info" ng-click="useExampleData('countries', 'China', example.China)">Try</button></p>
<pre>{{example.China}}</pre>
</li>
<li>
<p>能渲染的地图类型(不区分 Mercator 和 Miller 类型): World 地区级别 <button class="btn btn-xs btn-info" ng-click="useExampleData('world', 'World', example.World)">Try</button></p>
<pre>{{example.World}}</pre>
</li>
</ul>
</div>
<hr>
<div>
<h1>数据格式说明:</h1>
如下:
<pre>{map: {}}</pre>
map 字段为 map 渲染数据内容,具体国家名字城市名字参看: <a href="http://jvectormap.com/maps/world/africa/">jvectormap</a> 的说明。
</div>
<hr>
<div>
<h1>Todo:</h1>
<ol>
<li><i class="fa fa-check-square-o"></i> </i>补充各种已有的地图</li>
<li>
<i class="fa fa-check-square-o"></i> 渲染例子
<ul>
<li><i class="fa fa-check-square-o"></i> 增加渲染例子</li>
<li><i class="fa fa-check-square-o"></i> 随机渲染例子</li>
<li><i class="fa fa-check-square-o"></i> 直接 Try 例子</li>
</ul>
</li>
<li>
<i class="fa fa-check-square-o"></i> 增强配置项
<ol>
<li><i class="fa fa-check-square-o"></i> 宽度高度</li>
<li><i class="fa fa-check-square-o"></i> 渲染颜色</li>
<li><i class="fa fa-check-square-o"></i> 推荐渲染颜色</li>
</ol>
</li>
<li>
<i class="fa fa-check-square-o"></i> 导出
<ol>
<li><i class="fa fa-check-square-o"></i> 导出图片</li>
<li><i class="fa fa-check-square-o"></i> 导出 SVG </li>
<li><i class="fa fa-check-square-o"></i> 导出 HTML </li>
<li><i class="fa fa-check-square-o"></i> 导出当前配置 </li>
<li><i class="fa fa-check-square-o"></i> 导入配置 </li>
</ol>
</li>
<li><i class="fa fa-check-square-o"></i> Github 仓库直接存储地图底图</li>
</ol>
</div>
<hr>
<div class="pay">
<!-- 赤裸裸的抄袭廖雪峰的, http://www.liaoxuefeng.com/webpage/donate#donate-weixin-10 -->
<h1>打赏:</h1>
<div ng-init="pay.type='wechat';pay.account='8.88';">
<p>如果您认为这小功能的质量不错,满足您的需求,完成了一堆领导说要画各种地图的任务,预期被领导赞赏和涨工资,不妨小额赞助我一下,让我有动力继续不断完善这个小功能。</p>
<p>赞助方式一共有 2 种:微信支付,支付宝支付。</p>
<p>请闭上眼睛随意选择,通过:
<span class="btn btn-success" ng-class="{'active': pay.type=='wechat'}" ng-click="pay.type='wechat'">微信</span>
<span class="btn btn-success" ng-class="{'active': pay.type=='alipay'}" ng-click="pay.type='alipay'">支付宝</span>
打赏我
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='0.88'}" ng-click="pay.account='0.88'">¥0.88</span>
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='8.88'}" ng-click="pay.account='8.88'">¥8.88</span>
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='28.88'}" ng-click="pay.account='28.88'">¥28.88</span>
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='48.88'}" ng-click="pay.account='48.88'">¥48.88</span>
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='88.88'}" ng-click="pay.account='88.88'">¥88.88</span>
<span class="btn btn-success" ng-show="pay.type!='alipay'" ng-class="{'active': pay.account=='8n'}" ng-click="pay.account='8n'">任意</span>
。
</p>
<p>扫我:<img ng-show="pay.type!='alipay'" ng-src="img/pay/{{pay.type}}-{{pay.account}}.jpg" alt="{{pay.type}}-{{pay.account}}" style="height: 260px;"> <img ng-show="pay.type=='alipay'" ng-src="img/pay/{{pay.type}}-8n.jpg" alt="{{pay.type}}-{{pay.account}}" style="height: 260px;"> <span ng-show="pay.type=='alipay'">支付宝扫码没法设定数目。</span></p>
</div>
</div>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/shenqihui/map">Map</a> is maintained by <a href="https://github.com/shenqihui">shenqihui</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
<!-- script -->
<script src="bower_components/tinycolor/dist/tinycolor-min.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/jquery-jvectormap-2.0.3/jquery-jvectormap-2.0.3.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-load/angular-load.js"></script>
<!-- map data -->
<!-- 初始化时候,有个世界地图 -->
<script src="map_vender/jquery-jvectormap-world-mill.js"></script>
<script src="js/index.js"></script>
<!-- script end -->
<!-- Google Analytics -->
<script type="text/javascript">
/* jshint -W033 */
/* jshint -W069 */
/* jshint -W030 */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48454013-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<!-- Baidu Analytics -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?a359010dd82707c1ee6d1ca5d64be33b";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Edn Baidu Analytics -->
</body>
</html>