UNPKG

declarations

Version:

[![npm version](https://badge.fury.io/js/declarations.svg)](https://www.npmjs.com/package/declarations)

1,658 lines (1,404 loc) 126 kB
// Type definitions for Google Earth Plugin // Project: https://developers.google.com/earth/ // Definitions by: Ilia Choly <https://github.com/icholy/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace google { export function load( moduleName: string, moduleVersion: string, optionalSettings?: any ): void; } declare namespace google.earth { /** * Specifies the current stage of the flow of events. */ export type GEEventPhaseEnum = any; /** * Specifies how a feature should be displayed in a list view. */ export type KmlListItemTypeEnum = any; /** * Specifies which color mode effect to apply to the base color. */ export type KmlColorModeEnum = any; /* * Specifies how the altitude property is interpreted. */ export type KmlAltitudeModeEnum = any; /** * Specifies how the link is refreshed. */ export type KmlRefreshModeEnum = any; /** * Specifies how the link is refreshed when the viewport changes. */ export type KmlViewRefreshModeEnum = any; /** * Specifies which units a value is specified in. */ type KmlUnitsEnum = any; /** * Specifies if the map type is Earth or sky mode. */ type GEMapTypeEnum = any; /** * Specifies if a control is always visible, always hidden, * or visible only when the user intends to use the control. */ type GEVisibilityEnum = any; /** * Specifies what to sample when performing a hit test. */ type GEHitTestModeEnum = any; /** * Specifies the size of the navigation control. */ type GENavigationControlEnum = any; /** * Specifies the state of viewer options, including sunlight, * Street View, and historical imagery. */ type GEViewerOptionsValueEnum = any; /* * Specifies the viewer option types. */ type GEViewerOptionsTypeEnum = any; /** * Whether or not the Google Earth Browser Plug-in and API are supported on the current browser and operating system. */ export function isSupported(): boolean; /** * Whether or not the Google Earth Browser Plug-in is currently installed on the user's machine. * * Note: if the plug-in is not installed, the user will be presented with a 'download' link upon calls to google.earth.createInstance(). */ export function isInstalled(): boolean; /** * Attempts to create an instance of the plugin under the given web browser HTML DOM node. * Upon success, calls the function passed in as the initCallback argument. * Upon failure, calls the function passed in as the failureCallback argument and displays an error message to the user in place of the plug-in object. * * Note: * * The HTML DOM must be loaded before this function can be called. * Common usage is to call this function upon the <body>'s load event, or to use google.setOnLoadCallback. */ export function createInstance( domNode: string|Element, initCallback: (plugin: GEPlugin) => void, failureCallback: (error: any) => void, options?: any ): void; /** * Attaches a listener to a given object for a specific event; when the event occurs on the object, the given callback is invoked. */ export function addEventListener( targetObject: any, eventID: string, listenerCallback: (event: KmlEvent) => void, useCapture?: boolean ): void; /** * Removes an event listener previously added using google.earth.addEventListener() from the event chain. * * Note: * * You must pass in the exact same function object as was passed to addEventListener. * If you are using an anonymous function callback, it will need to be refactored into its own variable. */ export function removeEventListener( targetObject: any, eventID: string, listenerCallback: (event: KmlEvent) => void, useCapture?: boolean ): void; /** * Retrieves and parses a KML or KMZ file at the given URL and returns an instance of a KmlFeature-derived class representing the parsed KML object model. * * Note: This function does not display the feature on the Earth. See below for more information. */ export function fetchKml( pluginInstance: GEPlugin, url: string, completionCallback: (feature: KmlFeature) => void ): void; /** * Efficiently executes an arbitrary, user-defined function (the batch function), minimizing the amount of overhead incurred during cross-process communication between the web browser and Google Earth Plugin. * This method is useful for batching together a large set of calls to the Earth API, for example, a large number of consecutive calls to KmlCoordArray.pushLatLngAlt. */ export function executeBatch(pluginInstance: GEPlugin, batchFunction: Function): void; /** * Sets the language to be used for new instances of the plugin. * Needs to be called before google.earth.createInstance(). * Affects road and border labels, the error message displayed when the plugin fails to load, as well as the language of the Terms of Use page linked from the plugin. */ export function setLanguage(languageCode: string): void; /** * This interface enables programmatic and user-driven interaction with photo overlays in the Google Earth Plugin. * * Note: This interface is still under development. */ export class GEPhotoOverlayViewer { /** * Enters the given photo overlay object, exiting any other currently active photo overlay. * If the argument is null, then any currently active photo overlay is exited and normal global navigation is enabled. */ setPhotoOverlay(photoOverlay: KmlPhotoOverlay): void; } /** * Used to manipulate the navigation controls in Google Earth. */ export class GENavigationControl { /** * Whether the control is always visible, always hidden, or visible only when the user intends to use the control. * * See also: * * * GEPlugin.VISIBILITY_SHOW * * GEPlugin.VISIBILITY_HIDE * * GEPlugin.VISIBILITY_AUTO */ getVisibility(): GEVisibilityEnum; /** * Whether the control is always visible, always hidden, or visible only when the user intends to use the control. * * See also: * * * GEPlugin.VISIBILITY_SHOW * * GEPlugin.VISIBILITY_HIDE * * GEPlugin.VISIBILITY_AUTO */ setVisibility(visibility: GEVisibilityEnum): void; /** * Specifies the size of the navigation control. * * See also: * * * GEPlugin.NAVIGATION_CONTROL_LARGE * * GEPlugin.NAVIGATION_CONTROL_SMALL */ getControlType(): GENavigationControlEnum; /** * Specifies the size of the navigation control. * * See also: * * * GEPlugin.NAVIGATION_CONTROL_LARGE * * GEPlugin.NAVIGATION_CONTROL_SMALL */ setControlType(controlType: GENavigationControlEnum): void; /** * The position of the navigation controls in Google Earth */ getScreenXY(): KmlVec2; /** * Enables or disables user-initiated entry to Street View imagery. * When true, the Pegman icon is present in the navigation controls, allowing a user to drag the Pegman onto a street to initiate Street View. * Users can also zoom down to ground level to enter Street View when this is set to true. */ setStreetViewEnabled(streetViewEnabled: boolean): void; /** * Whether Street View is enabled in the navigation controls. */ getStreetViewEnabled(): boolean; } /** * Defines a tour, which is a playlist of scripted camera and update events. * * Note: This interface is still under development. */ export class KmlTour extends KmlFeature {} /** * This interface enables programmatic and user-driven interaction with KML tours in the Google Earth Plugin. * * Note: This interface is still under development. */ export class GETourPlayer { /** * Enters the given tour object, exiting any other currently active tour. * This method does not automatically begin playing the tour. * If the argument is null, then any currently active tour is exited and normal globe navigation is enabled. */ setTour(tour: KmlTour): void; /** * Plays the currently active tour. */ play(): void; /** * Pauses the currently active tour. */ pause(): void; /** * Resets the currently active tour, stopping playback and rewinding to the start of the tour. */ reset(): void; /** * The current elapsed playing time of the active tour, in seconds. */ getCurrentTime(): number; /** * The current elapsed playing time of the active tour, in seconds. */ setCurrentTime(currentTime: number): void; /** * The total duration of the active tour, in seconds. If no tour is loaded, the behavior of this method is undefined. */ getDuration(): number; } /** * This interface contains result information obtained by calling GEView's hitTest method. * * See also: * * * GEView.hitTest */ export class GEHitTestResult { /** * Latitude of sampled point. */ getLatitude(): number; /** * Latitude of sampled point. */ setLatitude(latitude: number): void; /** * Longitude of sampled point. */ getLongitude(): number; /** * Longitude of sampled point. */ setLongitude(longitude: number): void; /** * Altitude of sampled point. */ getAltitude(): number; /** * Altitude of sampled point. */ setAltitude(altitude: number): void; } /** * Maps between two different icon styles. * Typically this interface is used to provide separate normal and highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon. */ export class KmlStyleMap extends KmlStyleSelector { /** * Sets both URLs for the placemark style. */ setUrl(normalStyleUrl: string, highlightStyleUrl: string): void; /** * Sets both placemark styles. */ setStyle(normalStyle: KmlStyle, highlightStyle: KmlStyle): void; /** * Defines a normal style for a placemark. */ getNormalStyleUrl(): string; /** * Defines a normal style for a placemark. */ setNormalStyleUrl(normalStyleUrl: string): void; /** * Defines highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth. */ getHighlightStyleUrl(): string; /** * Defines highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth. */ setHighlightStyleUrl(highlightStyleUrl: string): void; /** * Defines a normal style for a placemark. */ getNormalStyle(): KmlStyle; /** * Defines a normal style for a placemark. */ setNormalStyle(normalStyle: KmlStyle): void; /** * Defines highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth. */ getHighlightStyle(): KmlStyle; /** * Defines highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth. */ setHighlightStyle(highlightStyle: KmlStyle): void; } /** * References a KML file or KMZ archive on a remote network. * Use the Link property to specify the location of the KML file. * Within that property, you can define the refresh options for updating the file, based on time and camera change. * NetworkLinks can be used in combination with Regions to handle very large datasets efficiently. */ export class KmlNetworkLink extends KmlFeature { /** * Sets the link, refreshVisibility, and flyToView for the network link. */ set(link: KmlLink, refreshVisibility: boolean, flyToView: boolean): void; /** * Specifies the location of any of the following: * * * KML files fetched by network links * * Image files used by icons in icon styles, ground overlays, and screen overlays * * Model files used in the Model object */ getLink(): KmlLink; /** * Specifies the location of any of the following: * * * KML files fetched by network links * * Image files used by icons in icon styles, ground overlays, and screen overlays * * Model files used in the Model object */ setLink(link: KmlLink): void; /** * A value of 0 leaves the visibility of features within the control of the Google Earth user. * Set the value to 1 to reset the visibility of features each time the NetworkLink is refreshed. * For example, suppose a Placemark within the linked KML file has visibility set to 1 and the NetworkLink has refreshVisibility set to 1. * When the file is first loaded into Google Earth, the user can clear the check box next to the item to turn off display in the 3D viewer. * However, when the NetworkLink is refreshed, the Placemark will be made visible again, since its original visibility state was TRUE. */ getRefreshVisibility(): boolean; /** * A value of 0 leaves the visibility of features within the control of the Google Earth user. * Set the value to 1 to reset the visibility of features each time the NetworkLink is refreshed. * For example, suppose a Placemark within the linked KML file has visibility set to 1 and the NetworkLink has refreshVisibility set to 1. * When the file is first loaded into Google Earth, the user can clear the check box next to the item to turn off display in the 3D viewer. * However, when the NetworkLink is refreshed, the Placemark will be made visible again, since its original visibility state was TRUE. */ setRefreshVisibility(refreshVisibility: boolean): void; /** * A value of 1 causes Google Earth to fly to the view of the LookAt or Camera in the NetworkLinkControl (if it exists). */ getFlyToView(): boolean; /** * A value of 1 causes Google Earth to fly to the view of the LookAt or Camera in the NetworkLinkControl (if it exists). */ setFlyToView(flyToView: boolean): void; } /** * Draws an image overlay fixed to the screen. * Sample uses for ScreenOverlays are compasses, logos, and heads-up displays. * ScreenOverlay sizing is determined by the size element. * Positioning of the overlay is handled by mapping a point in the image specified by screenXY to a point on the screen specified by overlayXY. * Then the image is rotated by rotation degrees about a point relative to the screen specified by rotationXY. * * Note: * * screenXY and overlayXY behave opposite to their corresponding behaviors in KML. * This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change. */ export class KmlScreenOverlay extends KmlOverlay { /** * Specifies a point on (or outside of) the overlay image that is mapped to the screen coordinate. * It requires x and y values, and the units for those values. * * Note: * * screenXY and overlayXY behave opposite to their corresponding behaviors in KML. * This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change. */ getScreenXY(): KmlVec2; /** * Specifies a point relative to the screen origin that the overlay image is mapped to. * The x and y values can be specified in three different ways: as pixels ("pixels"), as fractions of the screen ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the screen. * The x and y positions can be specified in different ways - for example, x can be in pixels and y can be a fraction. * The origin of the coordinate system is in the lower left corner of the screen. * * Note: * * screenXY and overlayXY behave opposite to their corresponding behaviors in KML. * This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change. */ getOverlayXY(): KmlVec2; /** * Point relative to the screen about which the screen overlay is rotated. */ getRotationXY(): KmlVec2; /** * Specifies the size of the image for the screen overlay, as follows: * * * A value of -1 indicates to use the native dimension * * A value of 0 indicates to maintain the aspect ratio * * A value of n sets the value of the dimension */ getSize(): KmlVec2; /** * Adjusts how the image is placed inside the field of view. * This element is useful if your image has been rotated and deviates slightly from a desired horizontal view. */ getRotation(): number; /** * Adjusts how the image is placed inside the field of view. * This element is useful if your image has been rotated and deviates slightly from a desired horizontal view. */ setRotation(rotation: number): void; } /** * Defines a photo overlay, which is a geographically located photograph of the Earth. * Photo overlays can be drawn onto 2D rectangles in three dimensional space, or in the case of panoramic photos, onto partial or full cylinders, or even spheres. * * Note: This interface is still under development. */ export class KmlPhotoOverlay extends KmlOverlay {} /** * Draws an image overlay draped onto the terrain. * The href child of Icon specifies the image to be used as the overlay. * If this object is omitted or contains no href, a rectangle is drawn using the color defined by the overlay. */ export class KmlGroundOverlay extends KmlOverlay { /** * Specifies the distance above the earth's surface. */ getAltitude(): number; /** * Specifies the distance above the earth's surface. */ setAltitude(altitude: number): void; /** * Specifies how the altitude property is interpreted. * * See also: * * * GEPlugin.ALTITUDE_CLAMP_TO_GROUND * * GEPlugin.ALTITUDE_ABSOLUTE * * GEPlugin.ALTITUDE_CLAMP_TO_SEA_FLOOR */ getAltitudeMode(): KmlAltitudeModeEnum; /** * Specifies how the altitude property is interpreted. * * See also: * * * GEPlugin.ALTITUDE_CLAMP_TO_GROUND * * GEPlugin.ALTITUDE_ABSOLUTE * * GEPlugin.ALTITUDE_CLAMP_TO_SEA_FLOOR */ setAltitudeMode(altitudeMode: KmlAltitudeModeEnum): void; /** * The bounding box of the ground overlay. */ getLatLonBox(): KmlLatLonBox; /** * The bounding box of the ground overlay. */ setLatLonBox(latLonBox: KmlLatLonBox): void; } /** * The KmlOverlay object is an abstract object and cannot be used directly in a KML file. * Overlay is the base type for image overlays drawn on the planet surface or on the screen. * Icon specifies the image to use and can be configured to reload images based on a timer or by camera changes. * This object also includes specifications for stacking order of multiple overlays and for adding color and transparency values to the base image. */ export class KmlOverlay extends KmlFeature { /** * Specifies the color values. */ getColor(): KmlColor; /** * Defines the stacking order for the images in overlapping overlays. * Overlays with higher drawOrder values are drawn on top of overlays with lower drawOrder values. */ getDrawOrder(): number; /** * Defines the stacking order for the images in overlapping overlays. * Overlays with higher drawOrder values are drawn on top of overlays with lower drawOrder values. */ setDrawOrder(drawOrder: number): void; /** * Defines the image associated with the Overlay. */ getIcon(): KmlIcon; /** * Defines the image associated with the Overlay. */ setIcon(icon: KmlIcon): void; } /** * This class controls the display of sunlight, historical imagery, and Street View panoramas in the plugin. * The KmlViewerOptions object is passed to KmlAbstractView.setViewerOptions() */ export class KmlViewerOptions extends KmlObject { /** * Returns the current state of the specified viewer option type. * * See also: * * * GEPlugin.OPTION_STREET_VIEW * * GEPlugin.OPTION_SUNLIGHT * * GEPlugin.OPTION_HISTORICAL_IMAGERY * * GEPlugin.OPTION_STATE_DEFAULT * * GEPlugin.OPTION_STATE_ENABLED * * GEPlugin.OPTION_STATE_DISABLED */ setOption(type: GEViewerOptionsTypeEnum, state: GEViewerOptionsValueEnum): void; /** * Set the state of viewer options, including sunlight, Street View, and historical imagery. * * See also: * * * GEPlugin.OPTION_STREET_VIEW * * GEPlugin.OPTION_SUNLIGHT * * GEPlugin.OPTION_HISTORICAL_IMAGERY * * GEPlugin.OPTION_STATE_DEFAULT * * GEPlugin.OPTION_STATE_ENABLED * * GEPlugin.OPTION_STATE_DISABLED */ getOption(type: GEViewerOptionsValueEnum): GEViewerOptionsValueEnum; } /** * Describes rotation of a 3D model's coordinate system to position the object in Google Earth. */ export class KmlOrientation extends KmlObject { /** * Sets the heading, tilt, and roll of a model. */ set(heading: number, tilt: number, roll: number): void; /** * Rotation about the z axis (normal to the Earth's surface). * A value of 0 (the default) equals North. * A positive rotation is clockwise around the z axis and specified in degrees from 0 to 360. */ getHeading(): number; /** * Rotation about the z axis (normal to the Earth's surface). * A value of 0 (the default) equals North. * A positive rotation is clockwise around the z axis and specified in degrees from 0 to 360. */ setHeading(heading: number): void; /** * Rotation about the x axis. * A positive rotation is clockwise around the x axis and specified in degrees from 0 to 360. */ getTilt(): number; /** * Rotation about the x axis. * A positive rotation is clockwise around the x axis and specified in degrees from 0 to 360. */ setTilt(tilt: number): void; /** * Rotation about the y axis. * A positive rotation is clockwise around the y axis and specified in degrees from 0 to 360. */ getRoll(): number; /** * Rotation about the y axis. * A positive rotation is clockwise around the y axis and specified in degrees from 0 to 360. */ setRoll(roll: number): void; } /** * Specifies the exact coordinates of the Model's origin in latitude, longitude, and altitude. * Latitude and longitude measurements are standard lat-lon projection with WGS84 datum. * Altitude is distance above the earth's surface, in meters, and is interpreted according to altitudeMode. */ export class KmlLocation extends KmlObject { /** * Sets the latitude, longitude, and altitude of the Model. */ setLatLngAlt(lat: number, lng: number, alt: number): void; /** * Longitude of the Model's location. * Angular distance in degrees, relative to the Prime Meridian. * Values west of the Meridian range from -180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. */ getLongitude(): number; /** * Longitude of the Model's location. * Angular distance in degrees, relative to the Prime Meridian. * Values west of the Meridian range from -180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. */ setLongitude(longitude: number): void; /** * Latitude of the camera location. * Degrees north or south of the Equator (0 degrees). * Values range from -90 degrees (South Pole) to 90 degrees (North Pole). */ getLatitude(): number; /** * Latitude of the camera location. * Degrees north or south of the Equator (0 degrees). * Values range from -90 degrees (South Pole) to 90 degrees (North Pole). */ setLatitude(latitude: number): void; /** * Specifies the distance above the earth's surface. */ getAltitude(): number; /** * Specifies the distance above the earth's surface. */ setAltitude(altitude: number): void; } /** * Scales a model along the x, y, and z axes in the model's coordinate space. */ export class KmlScale extends KmlObject { /** * Sets the x, y, and z coordinates for a model. */ set(x: number, y: number, z: number): void; /** * Indicates the x coordinate. */ getX(): number; /** * Indicates the x coordinate. */ setX(x: number): void; /** * Indicates the y coordinate. */ getY(): number; /** * Indicates the y coordinate. */ setY(y: number): void; /** * Indicates the z coordinate. */ getZ(): number; /** * Indicates the z coordinate. */ setZ(z: number): void; } /** * A single tuple consisting of floating point values for longitude, latitude, and altitude (in that order). * Longitude and latitude values are in degrees. * * * longitude = -180 and <= 180 * * latitude = -90 and = 90 * * altitude values (optional) are in meters above sea level */ export class KmlCoord { /** * Sets the latitude, longitude, altitude. */ setLatLngAlt(latitude: number, longitude: number, altitude: number): void; /** * Degrees north or south of the Equator (0 degrees). * Values range from -90 degrees (South Pole) to 90 degrees (North Pole). */ getLatitude(): number; /** * Degrees north or south of the Equator (0 degrees). * Values range from -90 degrees (South Pole) to 90 degrees (North Pole). */ setLatitude(latitude: number): void; /** * Angular distance in degrees, relative to the Prime Meridian. Values west of the Meridian range from -180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. */ getLongitude(): number; /** * Angular distance in degrees, relative to the Prime Meridian. Values west of the Meridian range from -180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. */ setLongitude(longitude: number): void; /** * Distance from the earth's surface. */ getAltitude(): number; /** * Distance from the earth's surface. */ setAltitude(altitude: number): void; } /** * The KmlCoordArray object defines an array of coordinates. */ export class KmlCoordArray { /** * Returns the coordinates at the given index. */ get(index: number): KmlCoord; /** * Sets the coordinates at the given index.. */ set(index: number, coord: KmlCoord): void; /** * Sets the latitude, longitude, and altitude. */ setLatLngAlt( index: number, latitude: number, longitude: number, altitude: number ): void; /** * Appends one or more new elements to the end of an array and returns the new length of the array. */ pushLatLngAlt( latitude: number, longitude: number, altitude: number ): void; /** * Appends one or more new elements to the end of an array and returns the new length of the array. */ push(coordOrList: KmlCoord): void; /** * Deletes the last element of an array, decrements the array length, and returns the value that is removed. */ pop(): KmlCoord; /** * Adds an element or elements to the beginning of an array. */ unshift(coordOrList: KmlCoord): number; /** * Adds an element or elements to the beginning of an array. */ unshiftLatLngAlt( latitude: number, longitude: number, altitude: number ): void; /** * Removes and returns the first element of the array. */ shift(): KmlCoord; /** * Reverses the order of the elements in the array. */ reverse(): void; /** * Clears all of the elements in the array */ clear(): void; /** * Specifies the length of the index array. */ getLength(): number; } /** * The object corresponding to the retangular region in which Google Earth is displayed. */ export class GEWindow extends GEEventEmitter { /** * Gives the Google Earth object focus. */ focus(): void; /** * Removes focus from the Google Earth object. */ blur(): void; /** * Toggles the overall visibility of Google Earth inside the browser. */ getVisibility(): boolean; /** * Toggles the overall visibility of Google Earth inside the browser. */ setVisibility(visibility: boolean): void; } /** * The GEGlobe class encapsulates the Google Earth globe to determine access and event behavior. */ export class GEGlobe extends KmlObject { /** * Returns the altitude for a given location on the globe. * If the altitude data for the location has not yet been loaded, the return value is 0. */ getGroundAltitude(lat: number, lon: number): number; /** * The top-level features currently in the Earth instance. */ getFeatures(): GEFeatureContainer; } /** * Controls the behavior of the camera that views the scene in Google Earth. */ export class GEView { /** * Returns the screen x,y coordinates of a given point on the globe. * * Tip: project() is the inverse of hitTest(). * * See also: * * * GEPlugin.ALTITUDE_RELATIVE_TO_GROUND * * GEPlugin.ALTITUDE_ABSOLUTE * * GEPlugin.ALTITUDE_RELATIVE_TO_SEA_FLOOR */ project( lat: number, lng: number, alt: number, altitudeMode: KmlAltitudeModeEnum ): KmlVec2; /** * Sets the camera that views the scene in Google Earth. */ setAbstractView(view: KmlAbstractView): void; /** * Creates and returns a new KmlLookAt object, initialized to the current camera position and orientation. * Use 'altitudeMode' to specify the altitude mode of the looked-at point. * * See also: * * * GEPlugin.ALTITUDE_RELATIVE_TO_GROUND * * GEPlugin.ALTITUDE_ABSOLUTE * * GEPlugin.ALTITUDE_RELATIVE_TO_SEA_FLOOR */ copyAsLookAt(altitudeMode: KmlAltitudeModeEnum): KmlLookAt; /** * Creates and returns a new KmlCamera object, initialized to the current camera position and orientation. * Use 'altitudeMode' to specify the altitude mode of the new camera. * * See also: * * * GEPlugin.ALTITUDE_RELATIVE_TO_GROUND * * GEPlugin.ALTITUDE_ABSOLUTE * * GEPlugin.ALTITUDE_RELATIVE_TO_SEA_FLOOR */ copyAsCamera(altitudeMode: KmlAltitudeModeEnum): KmlCamera; /** * Returns a bounding box that completely contains the region of the globe that is currently visible. * The returned box will be larger than what is strictly visible, if that is necessary to include everything that is visible. */ getViewportGlobeBounds(): KmlLatLonBox; /** * Given a point on the screen in pixel coordinates, returns a GEHitTestResult with information about the geographic location corresponding to the point on the screen. * Tip: hitTest() is the inverse of project(). * * See also: * * * GEPlugin.UNITS_PIXELS * * GEPlugin.UNITS_INSET_PIXELS * * GEPlugin.UNITS_FRACTION * * GEPlugin.HIT_TEST_GLOBE * * GEPlugin.HIT_TEST_TERRAIN * * GEPlugin.HIT_TEST_BUILDINGS */ hitTest( x: number, xUnits: KmlUnitsEnum, y: number, yUnits: KmlUnitsEnum, mode: GEHitTestModeEnum ): GEHitTestResult; } /** * Defines an image associated with an Icon style or overlay. */ export class KmlIcon extends KmlLink { /** * Gets the offset from the left (<gx:x>), in pixels, of the icon. */ getX(): number; /** * Specifies the icon's offset (<gx:x>), in pixels from the left side of its icon palette, if a palette has been specified in the <href> element. */ setX(x: number): number; /** * Gets the offset from the bottom (<gx:y>), in pixels, of the icon. */ getY(): number; /** * Specifies the offset (<gx:y>), in pixels from the bottom of its icon palette, if a palette has been specified in the <href> element. */ setY(y: number): void; /** * Gets the width (<gx:w>), in pixels, of the icon. */ getW(): number; /** * Specifies the width (<gx:w>), in pixels, of the icon to use. */ setW(w: number): void; /** * Gets the height (<gx:h>), in pixels, of the icon. */ getH(): number; /** * Specifies the height (<gx:h>), in pixels, of the icon to use. */ setH(h: number): void; } /** * Specifies the location of any KML files fetched by network links, image files used by icons in icon styles, ground overlays, and screen overlays, or model files used in the Model object. */ export class KmlLink extends KmlObject { /** * A URL (either an HTTP address or a local file specification). * When the parent of Link is a NetworkLink, href is a KML file. * When the parent of Link is a Model, href is a COLLADA file. * When the parent of Link is an Overlay, href is an image. */ getHref(): string; /** * A URL (either an HTTP address or a local file specification). * When the parent of Link is a NetworkLink, href is a KML file. * When the parent of Link is a Model, href is a COLLADA file. * When the parent of Link is an Overlay, href is an image. */ setHref(href: string): void; /** * Specifies to use a time-based refresh mode. * * See also: * * * GEPlugin.REFRESH_ON_CHANGE * * GEPlugin.REFRESH_ON_INTERVAL * * GEPlugin.REFRESH_ON_EXPIRE */ getRefreshMode(): KmlRefreshModeEnum; /** * Specifies to use a time-based refresh mode. * * See also: * * * GEPlugin.REFRESH_ON_CHANGE * * GEPlugin.REFRESH_ON_INTERVAL * * GEPlugin.REFRESH_ON_EXPIRE */ setRefreshMode(refreshMode: KmlRefreshModeEnum): void; /** * Indicates to refresh the file every n seconds. */ getRefreshInterval(): number; /** * Indicates to refresh the file every n seconds. */ setRefreshInterval(refreshInterval: number): void; /** * Specifies how the link is refreshed when the viewport changes. * * See also: * * * GEPlugin.VIEW_REFRESH_NEVER * * GEPlugin.VIEW_REFRESH_ON_STOP * * GEPlugin.VIEW_REFRESH_ON_REGION */ getViewRefreshMode(): KmlViewRefreshModeEnum; /** * Specifies how the link is refreshed when the viewport changes. * * See also: * * * GEPlugin.VIEW_REFRESH_NEVER * * GEPlugin.VIEW_REFRESH_ON_STOP * * GEPlugin.VIEW_REFRESH_ON_REGION */ setViewRefreshMode(viewRefreshMode: KmlViewRefreshModeEnum): void; /** * Specifies how the link is refreshed when the camera changes. */ getViewRefreshTime(): number; /** * Specifies how the link is refreshed when the camera changes. */ setViewRefreshTime(viewRefreshTime: number): void; /** * Scales the BBOX parameters before sending them to the server. * A value less than 1 specifies to use less than the full view (screen). * A value greater than 1 specifies to fetch an area that extends beyond the edges of the current view. */ getViewBoundScale(): number; /** * Scales the BBOX parameters before sending them to the server. * A value less than 1 specifies to use less than the full view (screen). * A value greater than 1 specifies to fetch an area that extends beyond the edges of the current view. */ setViewBoundScale(viewBoundScale: number): void; /** * Specifies the format of the query string that is appended to the Link's href before the file is fetched. * (If the href specifies a local file, this element is ignored.) */ getViewFormat(): string; /** * Specifies the format of the query string that is appended to the Link's href before the file is fetched. * (If the href specifies a local file, this element is ignored.) */ setViewFormat(viewFormat: string): void; } /** * Controls time in the plugin. */ export class GETime { /** * Set the plugin's clock rate. * A value of 1 corresponds with real time; to pass one year in the plugin for every real second, set the rate to 31536000 (60 times 60 times 24 times 365). */ setRate(rate: number): void; /** * Get the current plugin clock rate. */ getRate(): number; /** * Returns the current computer clock time as a KmlTimeStamp object. */ getSystemTime(): KmlTimeStamp; /** * Returns the GETimeControl object; this is the time slider. */ getControl(): GETimeControl; /** * Whether or not historical imagery is enabled. */ getHistoricalImageryEnabled(): boolean; /** * Turn historical imagery on or off. * For more information, read the Time chapter of the Developer's Guide. */ setHistoricalImageryEnabled(historicalImageryEnabled: boolean): void; /** * Get the current plugin time as a KmlTimeStamp or KmlTimeSpan. */ getTimePrimitive(): KmlTimePrimitive; /** * Sets the current plugin time. */ setTimePrimitive(timePrimitive: KmlTimePrimitive): void; } /** * Used to manipulate the behavior of the Google Earth options such as, navigation, flyToSpeed, scroll wheel speed and so on. */ export class GEOptions { /** * Sets the map type to Earth or sky mode. */ setMapType(type: GEMapTypeEnum): void; /** * Speed of zoom when user rolls the mouse wheel. Default is 1. * Set to a negative number to reverse the zoom direction. */ getScrollWheelZoomSpeed(): number; /** * Speed of zoom when user rolls the mouse wheel. Default is 1. * Set to a negative number to reverse the zoom direction. */ setScrollWheelZoomSpeed(scrollWheelZoomSpeed: number): void; /** * Specifies the speed at which the camera moves (0 to 5.0). * Set to SPEED_TELEPORT to immediately appear at selected destination. * * See also: * * * GEPlugin.SPEED_TELEPORT */ getFlyToSpeed(): number; /** * Specifies the speed at which the camera moves (0 to 5.0). * Set to SPEED_TELEPORT to immediately appear at selected destination. * * See also: * * * GEPlugin.SPEED_TELEPORT */ setFlyToSpeed(flyToSpeed: number): void; /** * Show or hide the status bar. Disabled by default. */ getStatusBarVisibility(): boolean; /** * Show or hide the status bar. Disabled by default. */ setStatusBarVisibility(statusBarVisibility: boolean): void; /** * Show or hide the grid. Disabled by default. */ getGridVisibility(): boolean; /** * Show or hide the grid. Disabled by default. */ setGridVisibility(gridVisibility: boolean): void; /** * Show or hide the overview map. Disabled by default. */ getOverviewMapVisibility(): boolean; /** * Show or hide the overview map. Disabled by default. */ setOverviewMapVisibility(overviewMapVisibility: boolean): void; /** * Show or hide the scale legend. Disabled by default. */ getScaleLegendVisibility(): boolean; /** * Show or hide the scale legend. Disabled by default. */ setScaleLegendVisibility(scaleLegendVisibility: boolean): void; /** * Show or hide the blue atmosphere that appears around the perimeter of the Earth. * On by default. */ getAtmosphereVisibility(): boolean; /** * Show or hide the blue atmosphere that appears around the perimeter of the Earth. * On by default. */ setAtmosphereVisibility(atmosphereVisibility: boolean): void; /** * Enable or disable user panning and zooming of the map. Enabled by default. * * Note: This also enables and disables keyboard navigation (arrow keys, page-up/page-down, etc). */ getMouseNavigationEnabled(): boolean; /** * Enable or disable user panning and zooming of the map. Enabled by default. * * Note: This also enables and disables keyboard navigation (arrow keys, page-up/page-down, etc). */ setMouseNavigationEnabled(mouseNavigationEnabled: boolean): void; /** * Returns true if the animation of features as they are added or removed from the globe has been enabled. */ getFadeInOutEnabled(): boolean; /** * Enable or disable the animation of a feature when it is added or removed from the Google Earth plugin. * The animation consists of a slight change of scale. Default is true. */ setFadeInOutEnabled(fadeInOutEnabled: boolean): void; /** * Returns true if display units are set to imperial units (feet and miles). * False denotes metric units (meters and kilometers). */ getUnitsFeetMiles(): boolean; /** * Set display units to imperial (feet and miles) or metric (meters and kilometers). * This setting affects only the values displayed in the status bar and the scale bar. * The values passed and returned with an object's getters and setters are always metric. */ setUnitsFeetMiles(unitsFeetMiles: boolean): void; /** * Enables or disables building selection. * If enabled, clicking a building will pop a feature balloon containing information from the Google 3D Warehouse database. */ setBuildingSelectionEnabled(buildingSelectionEnabled: boolean): void; /** * Whether or not building selection is enabled. */ getBuildingSelectionEnabled(): boolean; /** * Returns true if building highlighting is enabled. */ getBuildingHighlightingEnabled(): boolean; /** * Enables or disables building highlighting. * When enabled, buildings will be highlighted when they are moused over. */ setBuildingHighlightingEnabled(buildingHighlightingEnabled: boolean): void; /** * Returns the terrain exaggeration value. Valid values are in the range of 1.0 through 3.0. */ getTerrainExaggeration(): number; /** * Set the terrain exaggeration value. Valid values are in the range of 1.0 through 3.0. * Attempting to set outside of this range will result in the value being clamped. */ setTerrainExaggeration(terrainExaggeration: number): void; /** * When enabled, the view will change to 'ground level view' when the camera reaches ground level. * This view provides pan and lookAt controls, but no zoom slider. * The tilt will be set to 90, or parallel with level ground. */ setAutoGroundLevelViewEnabled(autoGroundLevelViewEnabled: boolean): void; /** * Whether automatic ground level view is enabled. */ getAutoGroundLevelViewEnabled(): boolean; } /** * Adds a node to the end of the list of children of a specified feature. * Returns the appended object. */ export class GESchemaObjectContainer<T extends KmlObject> { /** * Adds a node to the end of the list of children of a specified feature. * Returns the appended object. */ appendChild(object: T): void; /** * Removes a node from the list of children of a specified object. */ removeChild(oldChild: T): void; /** * Inserts a child before the referenced child in the list of objects. */ insertBefore(newChild: T, refChild: T): void; /** * Replaces existing child in the list of features. * Returns the old child. */ replaceChild(newChild: T, oldChild: T): void; /** * Returns true if the container is not empty. */ hasChildNodes(): boolean; /** * First child in the list of objects. */ getFirstChild(): T; /** * Last child in the list of objects. */ getLastChild(): T; /** * List of features (for KmlContainer), or list of features, styles, and schemas (for KmlDocument). * Returns true if there are any child nodes. */ getChildNodes(): KmlObjectList<T>; } /** * A container class that holds one or more features and allows the creation of nested hierarchies. */ export class GEFeatureContainer extends GESchemaObjectContainer<KmlFeature> {} /** * A container object that contains an array of geometries, typically the children of a multi-geometry. */ export class GEGeometryContainer extends GESchemaObjectContainer<KmlGeometry> {} /** * A container object that contains an array of closed line strings, typically the outer boundary of a Polygon. * Optionally, a LinearRing can also be used as the inner boundary of a Polygon to create holes in the Polygon. * A Polygon can contain multiple LinearRing objects used as inner boundaries. */ export class GELinearRingContainer extends GESchemaObjectContainer<KmlLinearRing> {} /** * A container that holds a collection of KmlStyle and KmlStyleMap objects. * The KmlStyleMap object selects a style based on the current mode of the Placemark. * An object derived from KmlStyleSelector is uniquely identified by its ID and its URL. */ export class GEStyleSelectorContainer extends GESchemaObjectContainer<KmlStyleSelector> {} /** * Defines the x and y coordinates of a 2D vector. */ export class KmlVec2 { /** * Sets the coordinates of the vector. */ set( x: number, xUnits: KmlUnitsEnum, y: number, yUnits: KmlUnitsEnum ): void; /** * Indicates the x coordinate. */ getX(): number; /** * Indicates the x coordinate. */ setX(x: number): void; /** * Indicates the y coordinate. */ getY(): number; /** * Indicates the y coordinate. */ setY(y: number): void; /** * Units in which the x value is specified. * * See also: * * * GEPlugin.UNITS_FRACTION * * GEPlugin.UNITS_PIXELS * * GEPlugin.UNITS_INSET_PIXELS */ getXUnits(): KmlUnitsEnum; /** * Units in which the x value is specified. * * See also: * * * GEPlugin.UNITS_FRACTION * * GEPlugin.UNITS_PIXELS * * GEPlugin.UNITS_INSET_PIXELS */ setXUnits(xUnits: KmlUnitsEnum): void; /** * Units in which the y value is specified. * * See also: * * * GEPlugin.UNITS_FRACTION * * GEPlugin.UNITS_PIyELS * * GEPlugin.UNITS_INSET_PIyELS */ getYUnits(): KmlUnitsEnum; /** * Units in which the y value is specified. * * See also: * * * GEPlugin.UNITS_FRACTION * * GEPlugin.UNITS_PIyELS * * GEPlugin.UNITS_INSET_PIyELS */ setYUnits(xUnits: KmlUnitsEnum): void; } /** * The GESun class controls the dawn to dusk views. */ export class GESun { /** * Specifies whether the feature is drawn in the 3D viewer when it is initially loaded. * In order for a feature to be visible, the visibility property and all of its ancestors must also be set to 1. */ getVisibility(): boolean; /** * Specifies whether the feature is drawn in the 3D viewer when it is initially loaded. * In order for a feature to be visible, the visibility property and all of its ancestors must also be set to 1. */ setVisibility(visibility: boolean): void; } /** * The KmlColor object values are expressed in hexadecimal notation. * The range of values for any one color component is 0 to 255 (00 to ff). * For alpha, 00 is fully transparent and ff is fully opaque. * The order of expression is aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). * For example, if you want to apply a blue color with 50 percent opacity to an overlay, * you would specify the following when setting color value: 7fff0000, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00. */ export class KmlColor { /** * Set the color of an object. */ set(color: string): void; /** * Returns the color of an object. */ get(): string; /** * red numerical value */ getR(): number; /** * red numerical value */ setR(r: number): void; /** * green numerical value */ getG(): number; /** * green numerical value */ setG(g: number): void; /** * blue numerical value */ getB(): number; /** * blue numerical value */ setB(b: number): void; /** * opacity value */ getA(): number; /** * opacity value */ setA(a: number): void; } /** * The event object used with all KMLObjects. * For more information about events, see the Document Object Model Events specification at h