Administrator
2022-09-14 58d006e05dcf2a20d0ec5367dd03d66a61db6849
提交 | 用户 | 时间
58d006 1 describe("Drawing HTML overlays", function() {
A 2   var map_with_overlays, overlay;
3
4   beforeEach(function() {
5     map_with_overlays = map_with_overlays || new GMaps({
6       el : '#map-with-overlays',
7       lat : -12.0433,
8       lng : -77.0283,
9       zoom : 12
10     });
11
12     overlay = overlay || map_with_overlays.drawOverlay({
13       lat: map_with_overlays.getCenter().lat(),
14       lng: map_with_overlays.getCenter().lng(),
15       layer: 'overlayLayer',
16       content: '<div class="overlay">Lima</div>',
17       verticalAlign: 'top',
18       horizontalAlign: 'center'
19     });
20   });
21
22   it("should add the overlay to the overlays collection", function() {
23     expect(map_with_overlays.overlays.length).toEqual(1);
24     expect(map_with_overlays.overlays[0]).toEqual(overlay);
25   });
26
27   it("should add the overlay in the current map", function() {
28     expect(overlay.getMap()).toEqual(map_with_overlays.map);
29   });
30 });