|
| 1 | +/** |
| 2 | + * Copyright 2022 Google LLC. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +import { LatLngBounds } from "../../maps/coordinates/latlng"; |
| 18 | +import { MapsEventListener } from "../../maps/event/event"; |
| 19 | +import { MVCObject } from "../../maps/event/mvcobject"; |
| 20 | + |
| 21 | +export class KmlLayer extends MVCObject implements google.maps.KmlLayer { |
| 22 | + public getDefaultViewport = jest |
| 23 | + .fn() |
| 24 | + .mockImplementation((): LatLngBounds | null => null); |
| 25 | + public getMap = jest |
| 26 | + .fn() |
| 27 | + .mockImplementation( |
| 28 | + (): google.maps.Map | google.maps.StreetViewPanorama | null | undefined => |
| 29 | + null |
| 30 | + ); |
| 31 | + public getMetadata = jest |
| 32 | + .fn() |
| 33 | + .mockImplementation((): google.maps.KmlLayerMetadata | null => null); |
| 34 | + public getStatus = jest |
| 35 | + .fn() |
| 36 | + .mockImplementation((): google.maps.KmlLayerStatus | null => null); |
| 37 | + public getUrl = jest |
| 38 | + .fn() |
| 39 | + .mockImplementation((): string | null | undefined => null); |
| 40 | + public getZIndex = jest |
| 41 | + .fn() |
| 42 | + .mockImplementation((): number | null | undefined => null); |
| 43 | + public setMap = jest |
| 44 | + .fn() |
| 45 | + .mockImplementation((map: google.maps.Map | null): void => { |
| 46 | + return; |
| 47 | + }); |
| 48 | + public setOptions = jest |
| 49 | + .fn() |
| 50 | + .mockImplementation((options: google.maps.KmlLayerOptions): void => { |
| 51 | + return; |
| 52 | + }); |
| 53 | + public setUrl = jest.fn().mockImplementation((url: string): void => { |
| 54 | + return; |
| 55 | + }); |
| 56 | + public setZIndex = jest.fn().mockImplementation((zIndex: number): void => { |
| 57 | + return; |
| 58 | + }); |
| 59 | + public addListener = jest |
| 60 | + .fn() |
| 61 | + .mockImplementation( |
| 62 | + ( |
| 63 | + eventName: string, |
| 64 | + handler: (this: KmlLayer, event: MouseEvent) => void |
| 65 | + ): google.maps.MapsEventListener => MapsEventListener |
| 66 | + ); |
| 67 | + constructor(opts?: google.maps.KmlLayerOptions | null) { |
| 68 | + super(); |
| 69 | + } |
| 70 | +} |
0 commit comments