forked from tmcw/docbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
2445 lines (2444 loc) · 177 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=11' />
<title>FoxGIS</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='css/base.css' rel='stylesheet' />
<link href='css/style.css' rel='stylesheet' />
<link href='css/railscasts.css' rel='stylesheet' />
</head>
<body>
<!--START--><div id='app'><div class="container unlimiter" data-reactroot="" data-reactid="1" data-react-checksum="-1904378264"><div class="fixed-top fixed-right space-left16" data-reactid="2"><div class="fill-light col6 pin-right" data-reactid="3"></div></div><div class="space-top5 scroll-styled overflow-auto pad1 width16 sidebar fixed-left fill-dark dark" data-reactid="4"><div class="pad0x small" data-reactid="5"><div class="small pad0x quiet space-top1" data-reactid="6">API</div><a href="#路径" class="line-height15 pad0x pad00y quiet block " data-reactid="7">路径</a><a href="#access_token" class="line-height15 pad0x pad00y quiet block " data-reactid="8">access_token</a><a href="#用户模块" class="line-height15 pad0x pad00y quiet block " data-reactid="9">用户模块</a><a href="#地图样式模块" class="line-height15 pad0x pad00y quiet block " data-reactid="10">地图样式模块</a><a href="#瓦片集模块" class="line-height15 pad0x pad00y quiet block " data-reactid="11">瓦片集模块</a><a href="#字体模块" class="line-height15 pad0x pad00y quiet block " data-reactid="12">字体模块</a><a href="#符号库模块" class="line-height15 pad0x pad00y quiet block " data-reactid="13">符号库模块</a><a href="#文件模块" class="line-height15 pad0x pad00y quiet block " data-reactid="14">文件模块</a><a href="#统计模块" class="line-height15 pad0x pad00y quiet block " data-reactid="15">统计模块</a><a href="#模板模块" class="line-height15 pad0x pad00y quiet block " data-reactid="16">模板模块</a><a href="#数据集模块" class="line-height15 pad0x pad00y quiet block " data-reactid="17">数据集模块</a></div></div><div class="space-left16" data-reactid="18"><div class="" data-reactid="19"><div class="clearfix" data-reactid="20"><div data-title="路径" class="keyline-top section contain clearfix " data-reactid="21"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="22"><h2 id="路径">路径</h2>
<p>所有API部署到以下基础路径:</p>
<pre><code>http://foxgis.com/api/v1
</code></pre>
</div></div><div data-title="access_token" class="keyline-top section contain clearfix " data-reactid="23"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="24"><h2 id="access_token">access_token</h2>
<p>除用户注册和用户登录外,所有的API都需要<code>access_token</code>获取权限。
请妥善保管好您的<code>access_token</code>,因为<code>access_token</code>可以获取到您的所有资源权限。
设置<code>access_token</code>有三种方式,优先级从上至下有:</p>
<table>
<thead>
<tr>
<th>方式</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>url方式</td>
<td>GET /{endpoint}?access_token={your_access_token}</td>
</tr>
<tr>
<td>cookie方式</td>
<td>cookies
["access_token"]
= {your_access_token}</td>
</tr>
<tr>
<td>header方式</td>
<td>headers
['x-access-token']
= {your_access_token}</td>
</tr>
</tbody>
</table>
</div></div><div data-title="用户模块" class="keyline-top section contain clearfix " data-reactid="25"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="26"><h2 id="用户模块">用户模块</h2>
<table>
<thead>
<tr>
<th>字段</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>用户名</td>
</tr>
<tr>
<td>access_token</td>
<td>访问令牌,只在用户注册和登录的时候返回</td>
</tr>
<tr>
<td>scope</td>
<td>用户信息访问范围,可以是
<code>private</code>
或
<code>public</code></td>
</tr>
<tr>
<td>is_verified</td>
<td>是否经过了认证</td>
</tr>
<tr>
<td>name</td>
<td>姓名</td>
</tr>
<tr>
<td>location</td>
<td>用户所在地区</td>
</tr>
<tr>
<td>organization</td>
<td>单位</td>
</tr>
<tr>
<td>position</td>
<td>职务/职称</td>
</tr>
<tr>
<td>telephone</td>
<td>固定电话</td>
</tr>
<tr>
<td>mobile</td>
<td>手机号码</td>
</tr>
<tr>
<td>email</td>
<td>电子邮箱</td>
</tr>
<tr>
<td>signature</td>
<td>个人签名</td>
</tr>
<tr>
<td>createdAt</td>
<td>用户创建时间</td>
</tr>
<tr>
<td>updatedAt</td>
<td>用户信息更新时间</td>
</tr>
<tr>
<td>downloadNum</td>
<td>用户下载文件数量</td>
</tr>
</tbody>
</table>
</div></div><div data-title="用户注册" class="keyline-top section contain clearfix " data-reactid="27"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="28"><h3 id="用户注册">用户注册</h3>
<p>用户注册不需要提供<code>access_token</code>。用户注册时必须填写<code>username</code>、<code>password</code>,可以选择性地完善自己的<code>name</code>、<code>location</code>、<code>organization</code>、<code>position</code>、<code>telephone</code>、<code>mobile</code>、<code>email</code>、<code>signature</code>信息。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="29"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>POST</div>
<div class='pad0 code small endpoint-url'>/users</div>
</div>
<h4 id="请求示例">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"password"</span>: <span class="hljs-string">"123456"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-number">123456789</span>,
<span class="hljs-attr">"location"</span>: <span class="hljs-string">"beijing"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"foxgis"</span>
}</code></pre>
<h4 id="响应成功">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"access_token"</span>: <span class="hljs-string">"{your_access_token}"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-number">123456789</span>,
<span class="hljs-attr">"location"</span>: <span class="hljs-string">"beijing"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"foxgis"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T12:33:02.689Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T11:33:02.689Z"</span>
}</code></pre>
<h4 id="响应失败">响应失败</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"error"</span>: <span class="hljs-string">"密码长度太短"</span>
}</code></pre>
</div></div><div data-title="用户登录" class="keyline-top section contain clearfix " data-reactid="30"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="31"><h3 id="用户登录">用户登录</h3>
<p>用户登录不需要<code>access_token</code>,但登录成功后会生成新的<code>access_token</code>。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="32"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>POST</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span></div>
</div>
<h4 id="请求示例-1">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"password"</span>: <span class="hljs-string">"123456"</span>
}</code></pre>
<h4 id="响应成功-1">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"张三"</span>,
<span class="hljs-attr">"access_token"</span>: <span class="hljs-string">"{your_access_token}"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-string">"12345678"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"WHU"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T10:18:59.498Z"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T11:37:35.551Z"</span>
}</code></pre>
<h4 id="响应失败-1">响应失败</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"error"</span>: <span class="hljs-string">"用户名或密码错误"</span>
}</code></pre>
</div></div><div data-title="获取用户信息" class="keyline-top section contain clearfix " data-reactid="33"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="34"><h3 id="获取用户信息">获取用户信息</h3>
<p>获取用户信息不会得到<code>access_token</code></p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="35"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-2">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-string">"12345678"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"WHU"</span>,
<span class="hljs-attr">"downloadNum"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T10:18:59.498Z"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T11:37:35.551Z"</span>
}</code></pre>
<h4 id="响应失败-2">响应失败</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"error"</span>: <span class="hljs-string">"用户不存在"</span>
}</code></pre>
</div></div><div data-title="获取用户列表" class="keyline-top section contain clearfix " data-reactid="36"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="37"><h3 id="获取用户列表">获取用户列表</h3>
<p>超级管理员可以获取一般管理员和普通用户的信息列表</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="38"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/users</div>
</div>
<h4 id="响应成功-3">响应成功</h4>
<pre><code class="hljs">[
{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-string">"12345678"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"WHU"</span>,
<span class="hljs-attr">"downloadNum"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T10:18:59.498Z"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T11:37:35.551Z"</span>
}
]</code></pre>
<h4 id="响应失败-3">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="更新用户信息" class="keyline-top section contain clearfix " data-reactid="39"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="40"><h3 id="更新用户信息">更新用户信息</h3>
<p>一般管理员和普通用户只允许更新各自用户信息中的<code>scope</code>、<code>name</code>、<code>location</code>、<code>organization</code>、<code>postition</code>、<code>telephone</code>、<code>mobile</code>、<code>email</code>、<code>signature</code>属性,而超级管理员可以更新其他所有非超级管理员的所有属性,包括<code>is_verified</code>、<code>role</code>。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="41"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>PATCH</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span></div>
</div>
<h4 id="请求示例-2">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"张三"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>
}</code></pre>
<h4 id="响应成功-4">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"张三"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-string">"12345678"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"WHU"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T10:18:59.498Z"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T11:37:35.551Z"</span>
}</code></pre>
<h4 id="响应失败-4">响应失败</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"error"</span>: <span class="hljs-string">"name字段过长"</span>
}</code></pre>
</div></div><div data-title="修改用户密码" class="keyline-top section contain clearfix " data-reactid="42"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="43"><h3 id="修改用户密码">修改用户密码</h3>
<p>修改成功后返回新的access_token。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="44"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>PATCH</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span>/password</div>
</div>
<h4 id="请求示例-3">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"oldPassword"</span>: <span class="hljs-string">"123456"</span>,
<span class="hljs-attr">"newPassword"</span>: <span class="hljs-string">"111111"</span>
}</code></pre>
<h4 id="响应成功-5">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"username"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"is_verified"</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"张三"</span>,
<span class="hljs-attr">"email"</span>: <span class="hljs-string">"[email protected]"</span>,
<span class="hljs-attr">"telephone"</span>: <span class="hljs-string">"12345678"</span>,
<span class="hljs-attr">"organization"</span>: <span class="hljs-string">"WHU"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-06T10:18:59.498Z"</span>,
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-06T11:37:35.551Z"</span>
}</code></pre>
<h4 id="响应失败-5">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="删除用户信息" class="keyline-top section contain clearfix " data-reactid="45"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="46"><h3 id="删除用户信息">删除用户信息</h3>
<p>超级管理员可以删除其他用户的信息。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="47"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>DELETE</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-6">响应成功</h4>
<pre><code class="hljs">HTTP 204</code></pre>
<h4 id="响应失败-6">响应失败</h4>
<pre><code class="hljs">HTTP 401</code></pre>
</div></div><div data-title="更新用户头像" class="keyline-top section contain clearfix " data-reactid="48"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="49"><h3 id="更新用户头像">更新用户头像</h3>
<p>上传的用户头像会自动缩放到100*100px</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="50"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>PUT</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span>/avatar</div>
</div>
</div></div><div data-title="获取用户头像" class="keyline-top section contain clearfix " data-reactid="51"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="52"><h3 id="获取用户头像">获取用户头像</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="53"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/users/<span class="strong">{username}</span>/avatar</div>
</div>
</div></div><div data-title="地图样式模块" class="keyline-top section contain clearfix " data-reactid="54"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="55"><h2 id="地图样式模块">地图样式模块</h2>
<p>管理地图样式,地图样式遵循Mapbox GL JS Spec。</p>
<p>字段信息:</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>style_id</td>
<td>地图样式ID</td>
</tr>
<tr>
<td>owner</td>
<td>所有者</td>
</tr>
<tr>
<td>scope</td>
<td>共享范围,可能的取值有
<code>private</code>
和
<code>public</code>
,默认为
<code>public</code></td>
</tr>
<tr>
<td>tags</td>
<td>标签</td>
</tr>
<tr>
<td>description</td>
<td>描述信息</td>
</tr>
<tr>
<td>version</td>
<td>版本</td>
</tr>
<tr>
<td>name</td>
<td>名称</td>
</tr>
<tr>
<td>metadata</td>
<td>元数据信息</td>
</tr>
<tr>
<td>center</td>
<td>中心点,
[lnt, lat]</td>
</tr>
<tr>
<td>zoom</td>
<td>缩放级别</td>
</tr>
<tr>
<td>bearing</td>
<td>方位角</td>
</tr>
<tr>
<td>pitch</td>
<td>倾斜度</td>
</tr>
<tr>
<td>sources</td>
<td>数据来源</td>
</tr>
<tr>
<td>sprite</td>
<td>符号库</td>
</tr>
<tr>
<td>glyphs</td>
<td>字体库</td>
</tr>
<tr>
<td>transition</td>
<td>渐变</td>
</tr>
<tr>
<td>layers</td>
<td>图层信息</td>
</tr>
<tr>
<td>createdAt</td>
<td>样式创建时间</td>
</tr>
<tr>
<td>updatedAt</td>
<td>样式更新时间</td>
</tr>
</tbody>
</table>
</div></div><div data-title="获取样式列表" class="keyline-top section contain clearfix " data-reactid="56"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="57"><h3 id="获取样式列表">获取样式列表</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="58"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-7">响应成功</h4>
<pre><code class="hljs">[{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-05T11:06:22.957Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Basic"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tags"</span>: ['basic', <span class="hljs-string">"style"</span>],
<span class="hljs-attr">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"BywXo5O-"</span>
},{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-05T11:06:00.957Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-05T10:06:00.957Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Empty"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tags"</span>: [<span class="hljs-string">"empty"</span>, <span class="hljs-string">"style"</span>]
<span class="hljs-string">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"SygXI5OZ"</span>
}]</code></pre>
<h4 id="响应失败-7">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="获取某个样式" class="keyline-top section contain clearfix " data-reactid="59"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="60"><h3 id="获取某个样式">获取某个样式</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="61"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span>/<span class="strong">{style_id}</span></div>
</div>
<h4 id="响应成功-8">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Basic"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"metadata"</span>: {
<span class="hljs-attr">"mapbox:autocomposite"</span>: <span class="hljs-literal">true</span>
},
<span class="hljs-attr">"glyphs"</span>: <span class="hljs-string">"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"</span>,
<span class="hljs-attr">"sources"</span>: {},
<span class="hljs-attr">"layers"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"background"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"background"</span>,
<span class="hljs-attr">"paint"</span>: {
<span class="hljs-attr">"background-color"</span>: <span class="hljs-string">"rgba(0,0,0,0)"</span>
}
}
],
<span class="hljs-attr">"pitch"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"bearing"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"center"</span>: [],
<span class="hljs-attr">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"draft"</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"BywXo5O-"</span>
}</code></pre>
<h4 id="响应失败-8">响应失败</h4>
<pre><code class="hljs">HTTP 404</code></pre>
</div></div><div data-title="新建样式" class="keyline-top section contain clearfix " data-reactid="62"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="63"><h3 id="新建样式">新建样式</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="64"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>POST</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span></div>
</div>
<h4 id="请求示例-4">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Basic"</span>,
<span class="hljs-attr">"metadata"</span>: {
<span class="hljs-attr">"mapbox:autocomposite"</span>: <span class="hljs-literal">true</span>
},
<span class="hljs-attr">"glyphs"</span>: <span class="hljs-string">"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"</span>,
<span class="hljs-attr">"sources"</span>: {},
<span class="hljs-attr">"layers"</span>: [
{
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"background"</span>,
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"background"</span>,
<span class="hljs-attr">"paint"</span>: {
<span class="hljs-attr">"background-color"</span>: <span class="hljs-string">"rgba(0,0,0,0)"</span>
}
}
]
}</code></pre>
<h4 id="响应成功-9">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Basic"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"metadata"</span>: {
<span class="hljs-attr">"mapbox:autocomposite"</span>: <span class="hljs-literal">true</span>
},
<span class="hljs-attr">"glyphs"</span>: <span class="hljs-string">"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"</span>,
<span class="hljs-attr">"sources"</span>: {},
<span class="hljs-attr">"layers"</span>: [
{
<span class="hljs-attr">"paint"</span>: {
<span class="hljs-attr">"background-color"</span>: <span class="hljs-string">"rgba(0,0,0,0)"</span>
},
<span class="hljs-attr">"type"</span>: <span class="hljs-string">"background"</span>,
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"background"</span>
}
],
<span class="hljs-attr">"pitch"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"bearing"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"center"</span>: [],
<span class="hljs-attr">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"BywXo5O-"</span>
}</code></pre>
<h4 id="响应失败-9">响应失败</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"error"</span>: <span class="hljs-string">"格式不正确"</span>
}</code></pre>
</div></div><div data-title="更新某个样式" class="keyline-top section contain clearfix " data-reactid="65"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="66"><h3 id="更新某个样式">更新某个样式</h3>
<p>字段除<code>style_id</code>、<code>owner</code>、<code>createdAt</code>、<code>updatedAt</code>都可更新</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="67"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>PATCH</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span>/<span class="strong">{style_id}</span></div>
</div>
<h4 id="请求示例-5">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"tags"</span>: [<span class="hljs-string">"foxgis"</span>],
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"abcd"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"judy"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam2"</span>,
<span class="hljs-attr">"center"</span>: [<span class="hljs-number">50.000000</span>, <span class="hljs-number">40.000000</span>],
<span class="hljs-attr">"layers"</span>: [{
<span class="hljs-attr">"paint"</span>: {
<span class="hljs-attr">"background-color"</span>: <span class="hljs-string">"rgba(1,1,1,1)"</span>
}
}]
}</code></pre>
<h4 id="响应成功-10">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-05T10:22:12.020Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-05T10:06:22.957Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"jingsam2"</span>,
<span class="hljs-attr">"tags"</span>: [<span class="hljs-string">"foxgis"</span>]
<span class="hljs-string">"metadata"</span>: {
<span class="hljs-attr">"mapbox:autocomposite"</span>: <span class="hljs-literal">true</span>
},
<span class="hljs-attr">"glyphs"</span>: <span class="hljs-string">"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"</span>,
<span class="hljs-attr">"layers"</span>: [
{
<span class="hljs-attr">"paint"</span>: {
<span class="hljs-attr">"background-color"</span>: <span class="hljs-string">"rgba(1,1,1,1)"</span>
}
}
],
<span class="hljs-attr">"pitch"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"bearing"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"center"</span>: [<span class="hljs-number">50</span>,<span class="hljs-number">40</span>],
<span class="hljs-attr">"version"</span>: <span class="hljs-number">8</span>,
<span class="hljs-attr">"draft"</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">"style_id"</span>: <span class="hljs-string">"BywXo5O-"</span>
}</code></pre>
<h4 id="响应失败-10">响应失败</h4>
<pre><code class="hljs">HTTP 404</code></pre>
</div></div><div data-title="删除样式" class="keyline-top section contain clearfix " data-reactid="68"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="69"><h3 id="删除样式">删除样式</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="70"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>DELETE</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span>/<span class="strong">{style_id}</span></div>
</div>
<h4 id="响应成功-11">响应成功</h4>
<pre><code class="hljs">HTTP 204</code></pre>
</div></div><div data-title="获取地图瓦片数据" class="keyline-top section contain clearfix " data-reactid="71"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="72"><h3 id="获取地图瓦片数据">获取地图瓦片数据</h3>
<p>获取地图样式的瓦片数据</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="73"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span>/<span class="strong">{style_id}</span>/<span class="strong">{z}</span>/<span class="strong">{x}</span>/<span class="strong">{y}</span>{@2x}.<span class="strong">{format}</span></div>
</div>
</div></div><div data-title="获取地图预览" class="keyline-top section contain clearfix " data-reactid="74"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="75"><h3 id="获取地图预览">获取地图预览</h3>
<p>获取设定范围的地图预览</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>zoom</td>
<td>缩放级别</td>
</tr>
<tr>
<td>scale</td>
<td>像素密度级别,以72dpi为基础等比例递增,取值范围
[1, 4]</td>
</tr>
<tr>
<td>bbox</td>
<td>以四至范围设置输出范围,格式为
[w, s, e, n]
,例如全球范围为
[-180,-85.0511,180,85.0511]</td>
</tr>
<tr>
<td>center</td>
<td>以中心点设置输出范围,格式为{x: 0, y: 0, width: 256, height: 256}</td>
</tr>
<tr>
<td>format</td>
<td>输出图片的格式,可以是png, jpg</td>
</tr>
<tr>
<td>quality</td>
<td>输出图片的质量,取值范围为
[0, 100]</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="76"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/styles/<span class="strong">{username}</span>/<span class="strong">{style_id}</span>/thumbnail?zoom=<span class="strong">{zoom}</span>&scale=<span class="strong">{scale}</span>&bbox=<span class="strong">{bbox}</span></div>
</div>
</div></div><div data-title="瓦片集模块" class="keyline-top section contain clearfix " data-reactid="77"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="78"><h2 id="瓦片集模块">瓦片集模块</h2>
<p>管理用户上传的制图数据</p>
<p>字段信息:</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>tileset_id</td>
<td>瓦片集ID</td>
</tr>
<tr>
<td>owner</td>
<td>所有者</td>
</tr>
<tr>
<td>scope</td>
<td>共享范围,可能的取值有
<code>private</code>
和
<code>public</code>
,默认为
<code>public</code></td>
</tr>
<tr>
<td>tags</td>
<td>标签</td>
</tr>
<tr>
<td>filename</td>
<td>上传文件名</td>
</tr>
<tr>
<td>filesize</td>
<td>上传文件大小</td>
</tr>
<tr>
<td>tilejson...</td>
<td>tilejson 相关字段,遵循Tilejson Spec标准</td>
</tr>
<tr>
<td>createdAt</td>
<td>瓦片集创建时间</td>
</tr>
<tr>
<td>updatedAt</td>
<td>瓦片集更新时间</td>
</tr>
</tbody>
</table>
</div></div><div data-title="获取瓦片集列表1" class="keyline-top section contain clearfix " data-reactid="79"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="80"><h3 id="获取瓦片集列表1">获取瓦片集列表1</h3>
<p>获取系统中所有瓦片集信息,普通用户只能获取个人或其他用户公开的瓦片集内容</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="81"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets</div>
</div>
<h4 id="响应成功-12">响应成功</h4>
<pre><code class="hljs">[{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Open Streets"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
},{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T06:47:29.012Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T06:47:26.847Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"beijing"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJvKDXgQ"</span>
}]</code></pre>
<h4 id="响应失败-11">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="获取瓦片集列表2" class="keyline-top section contain clearfix " data-reactid="82"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="83"><h3 id="获取瓦片集列表2">获取瓦片集列表2</h3>
<p>获取系统中某个用户{username}上传的瓦片集信息</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="84"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-13">响应成功</h4>
<pre><code class="hljs">[{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Open Streets"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
},{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T06:47:29.012Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T06:47:26.847Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"beijing"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJvKDXgQ"</span>
}]</code></pre>
<h4 id="响应失败-12">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="获取瓦片集信息" class="keyline-top section contain clearfix " data-reactid="85"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="86"><h3 id="获取瓦片集信息">获取瓦片集信息</h3>
<p>获取瓦片集信息,以tilejson格式表达。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="87"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span></div>
</div>
<h4 id="响应成功-14">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Open Streets"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
}</code></pre>
<h4 id="响应失败-13">响应失败</h4>
<pre><code class="hljs">HTTP 404</code></pre>
</div></div><div data-title="获取切片状态" class="keyline-top section contain clearfix " data-reactid="88"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="89"><h3 id="获取切片状态">获取切片状态</h3>
<p>获取瓦片集切片时的状态。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="90"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span>/status</div>
</div>
<h4 id="响应成功-15">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filename"</span>: <span class="hljs-string">"SD.json"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">909466</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"SD"</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">11</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">5</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1.0.0"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"vector_layers"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
}</code></pre>
<h4 id="响应失败-14">响应失败</h4>
<pre><code class="hljs">HTTP 404</code></pre>
</div></div><div data-title="上传数据" class="keyline-top section contain clearfix " data-reactid="91"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="92"><h3 id="上传数据">上传数据</h3>
<p>上传数据,系统根据上传的数据自动地转换为瓦片数据,支持的格式有<code>mbtiles</code>、<code>geojson</code>、<code>topojson</code>、<code>shapefile</code>、<code>tif</code>。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="93"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>POST</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-16">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"tags"</span>: [],
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
}</code></pre>
<h4 id="响应失败-15">响应失败</h4>
<pre><code class="hljs">HTTP 500</code></pre>
</div></div><div data-title="更新瓦片集信息" class="keyline-top section contain clearfix " data-reactid="94"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="95"><h3 id="更新瓦片集信息">更新瓦片集信息</h3>
<p>可更新的字段有<code>scope</code>、<code>tags</code>、<code>name</code>、<code>description</code>、<code>vector_layers</code>。</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="96"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>PATCH</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span></div>
</div>
<h4 id="请求示例-6">请求示例</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>
}</code></pre>
<h4 id="响应成功-17">响应成功</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"updatedAt"</span>: <span class="hljs-string">"2016-05-23T05:51:34.710Z"</span>,
<span class="hljs-attr">"createdAt"</span>: <span class="hljs-string">"2016-05-23T05:51:33.199Z"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"public"</span>,
<span class="hljs-attr">"owner"</span>: <span class="hljs-string">"jingsam"</span>,
<span class="hljs-attr">"filesize"</span>: <span class="hljs-number">65794689024</span>,
<span class="hljs-attr">"description"</span>: <span class="hljs-string">"Extract from osm2vectortiles.org"</span>,
<span class="hljs-attr">"format"</span>: <span class="hljs-string">"pbf"</span>,
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"Open Streets"</span>,
<span class="hljs-attr">"attribution"</span>: <span class="hljs-string">"&copy; OpenStreetMap contributors"</span>,
<span class="hljs-attr">"progress"</span>: <span class="hljs-number">100</span>,
<span class="hljs-attr">"center"</span>: [ <span class="hljs-number">116.3400305</span>, <span class="hljs-number">39.9589555</span>, <span class="hljs-number">10</span> ],
<span class="hljs-attr">"bounds"</span>: [ <span class="hljs-number">116.04142</span>, <span class="hljs-number">39.75872</span>, <span class="hljs-number">116.638641</span>, <span class="hljs-number">40.159191</span> ],
<span class="hljs-attr">"maxzoom"</span>: <span class="hljs-number">14</span>,
<span class="hljs-attr">"minzoom"</span>: <span class="hljs-number">0</span>,
<span class="hljs-attr">"data"</span>: [],
<span class="hljs-attr">"grids"</span>: [],
<span class="hljs-attr">"tiles"</span>: [],
<span class="hljs-attr">"scheme"</span>: <span class="hljs-string">"xyz"</span>,
<span class="hljs-attr">"version"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-attr">"tilejson"</span>: <span class="hljs-string">"2.1.0"</span>,
<span class="hljs-attr">"scope"</span>: <span class="hljs-string">"private"</span>,
<span class="hljs-attr">"tileset_id"</span>: <span class="hljs-string">"rJ6P9GlQ"</span>
}</code></pre>
<h4 id="响应失败-16">响应失败</h4>
<pre><code class="hljs">HTTP 404</code></pre>
</div></div><div data-title="删除瓦片集" class="keyline-top section contain clearfix " data-reactid="97"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="98"><h3 id="删除瓦片集">删除瓦片集</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="99"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>DELETE</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span></div>
</div>
<h4 id="响应成功-18">响应成功</h4>
<pre><code class="hljs">HTTP 204</code></pre>
</div></div><div data-title="获取瓦片" class="keyline-top section contain clearfix " data-reactid="100"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="101"><h3 id="获取瓦片">获取瓦片</h3>
<p>根据<code>z</code>、<code>x</code>、<code>y</code>获取单张瓦片</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="102"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span>/<span class="strong">{z}</span>/<span class="strong">{x}</span>/<span class="strong">{y}</span>{@2x}.<span class="strong">{format}</span></div>
</div>
</div></div><div data-title="下载源文件" class="keyline-top section contain clearfix " data-reactid="103"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="104"><h3 id="下载源文件">下载源文件</h3>
<p>下载生成瓦片的原始数据</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="105"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tilesets/<span class="strong">{username}</span>/<span class="strong">{tileset_id}</span>/raw</div>
</div>
</div></div><div data-title="字体模块" class="keyline-top section contain clearfix " data-reactid="106"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="107"><h2 id="字体模块">字体模块</h2>
<p>制图模块管理用户上传的字体。</p>
<p>字段信息:</p>
<table>
<thead>
<tr>
<th>字段</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>fontname</td>
<td>字体名称</td>
</tr>
<tr>
<td>owner</td>
<td>所有者</td>
</tr>
<tr>
<td>scope</td>
<td>共享范围,可能的取值有
<code>private</code>
和
<code>public</code>
,默认为
<code>public</code></td>
</tr>
<tr>
<td>family_name</td>
<td>字族名称</td>
</tr>
<tr>
<td>style_name</td>
<td>字体样式,如
<code>Regular</code>
,
<code>Bold</code>
,
<code>Italic</code></td>
</tr>
<tr>
<td>coverages</td>
<td>字体语言覆盖率信息</td>
</tr>
<tr>
<td>coverages.name</td>
<td>语言名称,如
<code>English</code></td>
</tr>
<tr>
<td>coverages.id</td>
<td>语言名称简写,如
<code>en</code></td>
</tr>
<tr>
<td>coverages.count</td>
<td>字体在该语言中的覆盖的字符数</td>
</tr>
<tr>
<td>coverages.total</td>
<td>该语言的中字符数</td>
</tr>
</tbody>
</table>
</div></div><div data-title="获取用户字体列表" class="keyline-top section contain clearfix " data-reactid="108"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="109"><h3 id="获取用户字体列表">获取用户字体列表</h3>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="110"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/fonts/<span class="strong">{username}</span></div>
</div>
<h4 id="响应成功-19">响应成功</h4>