Administrator
2022-09-14 58d006e05dcf2a20d0ec5367dd03d66a61db6849
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
describe("Adding Map Styles", function() {
  var map_with_styles;
 
  beforeEach(function() {
    map_with_styles = map_with_styles || new GMaps({
      el : '#map-with-styles',
      lat : -12.0433,
      lng : -77.0283,
      zoom : 12
    });
 
    map_with_styles.addStyle({
      styledMapName : {
        name : 'Lighter'
      },
      mapTypeId : 'lighter',
      styles : [
        {
          elementType : 'geometry',
          stylers : [
            { lightness : 50 }
          ]
        },
        {
          elementType : 'labels',
          stylers : [
            { visibility : 'off' }
          ]
        },
      ]
    });
  });
 
  it("should add a MapType to the current map", function() {
    expect(map_with_styles.map.mapTypes.get('lighter')).toBeDefined();
  });
 
  it("should update the styles in the current map", function() {
    map_with_styles.setStyle('lighter');
 
    expect(map_with_styles.getMapTypeId()).toEqual('lighter');
  });
});