提交 | 用户 | 时间
|
58d006
|
1 |
describe("Adding Map Styles", function() { |
A |
2 |
var map_with_styles; |
|
3 |
|
|
4 |
beforeEach(function() { |
|
5 |
map_with_styles = map_with_styles || new GMaps({ |
|
6 |
el : '#map-with-styles', |
|
7 |
lat : -12.0433, |
|
8 |
lng : -77.0283, |
|
9 |
zoom : 12 |
|
10 |
}); |
|
11 |
|
|
12 |
map_with_styles.addStyle({ |
|
13 |
styledMapName : { |
|
14 |
name : 'Lighter' |
|
15 |
}, |
|
16 |
mapTypeId : 'lighter', |
|
17 |
styles : [ |
|
18 |
{ |
|
19 |
elementType : 'geometry', |
|
20 |
stylers : [ |
|
21 |
{ lightness : 50 } |
|
22 |
] |
|
23 |
}, |
|
24 |
{ |
|
25 |
elementType : 'labels', |
|
26 |
stylers : [ |
|
27 |
{ visibility : 'off' } |
|
28 |
] |
|
29 |
}, |
|
30 |
] |
|
31 |
}); |
|
32 |
}); |
|
33 |
|
|
34 |
it("should add a MapType to the current map", function() { |
|
35 |
expect(map_with_styles.map.mapTypes.get('lighter')).toBeDefined(); |
|
36 |
}); |
|
37 |
|
|
38 |
it("should update the styles in the current map", function() { |
|
39 |
map_with_styles.setStyle('lighter'); |
|
40 |
|
|
41 |
expect(map_with_styles.getMapTypeId()).toEqual('lighter'); |
|
42 |
}); |
|
43 |
}); |