File tree Expand file tree Collapse file tree 2 files changed +77
-0
lines changed Expand file tree Collapse file tree 2 files changed +77
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+
4
+ < head >
5
+ < meta charset ='utf-8 ' />
6
+ < title > Show and hide layers</ title >
7
+ < meta name ='viewport ' content ='initial-scale=1,maximum-scale=1,user-scalable=no ' />
8
+ < script include ="compare " src ="../../libs/zondyclient/include-mapboxgl-local.js "> </ script >
9
+ < style >
10
+ body {
11
+ margin : 0 ;
12
+ padding : 0 ;
13
+ }
14
+
15
+ # map {
16
+ position : absolute;
17
+ top : 0 ;
18
+ bottom : 0 ;
19
+ width : 100% ;
20
+ }
21
+ </ style >
22
+ </ head >
23
+
24
+ < body >
25
+
26
+ < style >
27
+ body {
28
+ overflow : hidden;
29
+ }
30
+
31
+ body * {
32
+ -webkit-touch-callout : none;
33
+ -webkit-user-select : none;
34
+ -moz-user-select : none;
35
+ -ms-user-select : none;
36
+ user-select : none;
37
+ }
38
+
39
+ .map {
40
+ position : absolute;
41
+ top : 0 ;
42
+ bottom : 0 ;
43
+ width : 100% ;
44
+ }
45
+ </ style >
46
+
47
+ < div id ='before ' class ='map '> </ div >
48
+ < div id ='after ' class ='map '> </ div >
49
+
50
+ < script >
51
+ //一定要去mapbox注册一个key,这个key会失效的
52
+ mapboxgl . accessToken =
53
+ 'pk.eyJ1IjoicGFybmRlZWRsaXQiLCJhIjoiY2o1MjBtYTRuMDhpaTMzbXhpdjd3YzhjdCJ9.sCoubaHF9-nhGTA-sgz0sA' ;
54
+
55
+ var beforeMap = new mapboxgl . Map ( {
56
+ container : 'before' ,
57
+ style : "http://192.168.10.185:6163/igs/rest/mrms/vtiles/styles/24.json" ,
58
+ zoom : 10 ,
59
+ pitch : 45 ,
60
+ center : [ 113 , 27 ]
61
+ } ) ;
62
+ var afterMap = new mapboxgl . Map ( {
63
+ container : 'after' ,
64
+ style : "http://192.168.10.185:6163/igs/rest/mrms/vtiles/styles/topology.json" ,
65
+ zoom : 10 ,
66
+ pitch : 45 ,
67
+ center : [ 113 , 27 ]
68
+ } ) ;
69
+ var map = new mapboxgl . Compare ( beforeMap , afterMap , {
70
+ // Set this to enable comparing two maps by mouse movement:
71
+ // mousemove: true
72
+ } ) ;
73
+ </ script >
74
+
75
+ </ body >
76
+
77
+ </ html >
You can’t perform that action at this time.
0 commit comments