typescript-closure-tools
Version:
Command-line tools to convert closure-style JSDoc annotations to typescript, and to convert typescript sources to closure externs files
1,628 lines (1,397 loc) • 151 kB
TypeScript
// Type definitions for OpenLayers.js 2.10
// Project: https://github.com/openlayers/openlayers
// Definitions by: Ilya Bolkhovsky <https://github.com/bolhovsky>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module OpenLayers {
export interface MapOptions {
projection?: string;
maxExtend?: Bounds;
center?: LonLat;
}
export interface DistanceOptions {
/**
* Return details from the distance calculation. Default is false.
*/
details?: boolean;
/**
* Calculate the distance from this geometry to the nearest edge of the target geometry. Default is true. If true, calling distanceTo from a geometry that is wholly contained within the target will result in a non-zero distance. If false, whenever geometries intersect, calling distanceTo will return 0. If false, details cannot be returned.
*/
edge?: boolean;
}
export interface BoundsOptions {
/**
* Whether or not to include the border. Default is true.
*/
inclusive?: boolean;
/**
* If a worldBounds is provided, the
* ll will be considered as contained if it exceeds the world bounds,
* but can be wrapped around the dateline so it is contained by this
* bounds.
*/
worldBounds?: Bounds;
}
export interface WrapDateLineOptions {
/**
* Allow for a margin of error
* with the 'left' value of this
* bound.
* Default is 0.
*/
leftTolerance?: number;
/**
* Allow for a margin of error
* with the 'right' value of this
* bound.
* Default is 0.
*/
rightTolerance?: number;
}
export interface LayerOptions {
}
export class Animation {
// TODO
}
export class String {
// TODO
}
export class Number {
// TODO
}
export class Function {
// TODO
}
export class Array {
// TODO
}
export class Console {
// TODO
}
export class Control {
// TODO
}
export class Event {
// TODO
}
export class Events {
/**
* Method: attachToElement
*
* Parameters:
* element - {HTMLDOMElement} a DOM element to attach browser events to
*/
attachToElement(element: HTMLElement) : void;
/**
* APIMethod: on
* Convenience method for registering listeners with a common scope.
* Internally, this method calls <register> as shown in the examples
* below.
*
* Example use:
* (code)
* // register a single listener for the "loadstart" event
* events.on({"loadstart": loadStartListener});
*
* // this is equivalent to the following
* events.register("loadstart", undefined, loadStartListener);
*
* // register multiple listeners to be called with the same `this` object
* events.on({
* "loadstart": loadStartListener,
* "loadend": loadEndListener,
* scope: object
* });
*
* // this is equivalent to the following
* events.register("loadstart", object, loadStartListener);
* events.register("loadend", object, loadEndListener);
* (end)
*
* Parameters:
* object - {Object}
*/
on(object: any) : void;
/**
* APIMethod: register
* Register an event on the events object.
*
* When the event is triggered, the 'func' function will be called, in the
* context of 'obj'. Imagine we were to register an event, specifying an
* OpenLayers.Bounds Object as 'obj'. When the event is triggered, the
* context in the callback function will be our Bounds object. This means
* that within our callback function, we can access the properties and
* methods of the Bounds object through the "this" variable. So our
* callback could execute something like:
* : leftStr = "Left: " + this.left;
*
* or
*
* : centerStr = "Center: " + this.getCenterLonLat();
*
* Parameters:
* type - {String} Name of the event to register
* obj - {Object} The object to bind the context to for the callback#.
* If no object is specified, default is the Events's 'object' property.
* func - {Function} The callback function. If no callback is
* specified, this function does nothing.
* priority - {Boolean|Object} If true, adds the new listener to the
* *front* of the events queue instead of to the end.
*
* Valid options for priority:
* extension - {Boolean} If true, then the event will be registered as
* extension event. Extension events are handled before all other
* events.
*/
register(type: string, obj: any, func: () => void, priority: boolean) : void;
/**
* APIMethod: registerPriority
* Same as register() but adds the new listener to the *front* of the
* events queue instead of to the end.
*
* TODO: get rid of this in 3.0 - Decide whether listeners should be
* called in the order they were registered or in reverse order.
*
*
* Parameters:
* type - {String} Name of the event to register
* obj - {Object} The object to bind the context to for the callback#.
* If no object is specified, default is the Events's
* 'object' property.
* func - {Function} The callback function. If no callback is
* specified, this function does nothing.
*/
registerPriority(type: string, obj: any, func: () => void) : void;
/**
* APIMethod: un
* Convenience method for unregistering listeners with a common scope.
* Internally, this method calls <unregister> as shown in the examples
* below.
*
* Example use:
* (code)
* // unregister a single listener for the "loadstart" event
* events.un({"loadstart": loadStartListener});
*
* // this is equivalent to the following
* events.unregister("loadstart", undefined, loadStartListener);
*
* // unregister multiple listeners with the same `this` object
* events.un({
* "loadstart": loadStartListener,
* "loadend": loadEndListener,
* scope: object
* });
*
* // this is equivalent to the following
* events.unregister("loadstart", object, loadStartListener);
* events.unregister("loadend", object, loadEndListener);
* (end)
*/
un(object: any) : void;
/**
* APIMethod: unregister
*
* Parameters:
* type - {String}
* obj - {Object} If none specified, defaults to this.object
* func - {Function}
*/
unregister(type: string, obj: any, func: () => void) : void;
/**
* Method: remove
* Remove all listeners for a given event type. If type is not registered,
* does nothing.
*
* Parameters:
* type - {String}
*/
remove(type: string) : void;
/**
* APIMethod: triggerEvent
* Trigger a specified registered event.
*
* Parameters:
* type - {String}
* evt - {Event || Object} will be passed to the listeners.
*
* Returns:
* {Boolean} The last listener return. If a listener returns false, the
* chain of listeners will stop getting called.
*/
triggerEvent(type: string, evt: Event) : boolean;
/**
* Method: handleBrowserEvent
* Basically just a wrapper to the triggerEvent() function, but takes
* care to set a property 'xy' on the event with the current mouse
* position.
*
* Parameters:
* evt - {Event}
*/
handleBrowserEvent(evt: Event) : void;
/**
* Method: getMousePosition
*
* Parameters:
* evt - {Event}
*
* Returns:
* {<OpenLayers.Pixel>} The current xy coordinate of the mouse, adjusted
* for offsets
*/
getMousePosition(evt: Event) : Pixel;
}
export class Feature {
// TODO
}
export class Filter {
// TODO
}
export class Format {
// TODO
}
export class Handler {
// TODO
}
export class Icon {
// TODO
}
export class Kinetic {
// TODO
}
export class Lang {
// TODO
}
export class Layer {
/**
*
*/
id: string;
/**
*
*/
name: string;
/**
*
*/
div: HTMLElement;
/**
* The layer's opacity. Float number between 0.0 and 1.0.
*/
opacity: number;
/**
* If a layer's display should not be scale-based, this should
* be set to true. This will cause the layer, as an overlay, to always
* be 'active', by always returning true from the calculateInRange()
* function.
*
* If not explicitly specified for a layer, its value will be
* determined on startup in initResolutions() based on whether or not
* any scale-specific properties have been set as options on the
* layer. If no scale-specific options have been set on the layer, we
* assume that it should always be in range.
*/
alwaysInRange: boolean;
/**
* The properties that are used for calculating resolutions information.
*/
RESOLUTION_PROPERTIES: string[];
/**
* APIProperty: events
* {<OpenLayers.Events>}
*
* Register a listener for a particular event with the following syntax:
* (code)
* layer.events.register(type, obj, listener);
* (end)
*
* Listeners will be called with a reference to an event object. The
* properties of this event depends on exactly what happened.
*
* All event objects have at least the following properties:
* object - {Object} A reference to layer.events.object.
* element - {DOMElement} A reference to layer.events.element.
*
* Supported map event types:
* loadstart - Triggered when layer loading starts. When using a Vector
* layer with a Fixed or BBOX strategy, the event object includes
* a *filter* property holding the OpenLayers.Filter used when
* calling read on the protocol.
* loadend - Triggered when layer loading ends. When using a Vector layer
* with a Fixed or BBOX strategy, the event object includes a
* *response* property holding an OpenLayers.Protocol.Response object.
* visibilitychanged - Triggered when the layer's visibility property is
* changed, e.g. by turning the layer on or off in the layer switcher.
* Note that the actual visibility of the layer can also change if it
* gets out of range (see <calculateInRange>). If you also want to catch
* these cases, register for the map's 'changelayer' event instead.
* move - Triggered when layer moves (triggered with every mousemove
* during a drag).
* moveend - Triggered when layer is done moving, object passed as
* argument has a zoomChanged boolean property which tells that the
* zoom has changed.
* added - Triggered after the layer is added to a map. Listeners will
* receive an object with a *map* property referencing the map and a
* *layer* property referencing the layer.
* removed - Triggered after the layer is removed from the map. Listeners
* will receive an object with a *map* property referencing the map and
* a *layer* property referencing the layer.
*/
events: Events;
/**
* This variable is set when the layer is added to
* the map, via the accessor function setMap()
*/
map: Map;
/**
* Whether or not the layer is a base layer. This should be set
* individually by all subclasses. Default is false
*/
isBaseLayer: boolean;
/**
* The layer's images have an alpha channel. Default is false.
*/
alpha: boolean;
/**
* Display the layer's name in the layer switcher. Default is true
*/
displayInLayerSwitcher: boolean;
/**
* The layer should be displayed in the map. Default is true.
*/
visibility: boolean;
/**
* Attribution string, displayed when an
* <OpenLayers.Control.Attribution> has been added to the map.
*/
attribution: string;
/**
* The current map resolution is within the layer's min/max
* range. This is set in <OpenLayers.Map.setCenter> whenever the zoom
* changes.
*/
inRange: boolean;
/**
* For layers with a gutter, the image is larger than
* the tile by twice the gutter in each dimension.
*/
imageSize: Size;
/**
* An optional object whose properties will be set on the layer.
* Any of the layer properties can be set as a property of the options
* object and sent to the constructor when the layer is created.
*/
options: Object;
/**
* An optional object whose properties will be set on the layer.
* Any of the layer properties can be set as a property of the options
* object and sent to the constructor when the layer is created.
*/
eventListeners: Object;
/**
* Determines the width (in pixels) of the gutter around image
* tiles to ignore. By setting this property to a non-zero value,
* images will be requested that are wider and taller than the tile
* size by a value of 2 x gutter. This allows artifacts of rendering
* at tile edges to be ignored. Set a gutter value that is equal to
* half the size of the widest symbol that needs to be displayed.
* Defaults to zero. Non-tiled layers always have zero gutter.
*/
gutter: number;
/**
* Specifies the projection of the layer.
* Can be set in the layer options. If not specified in the layer options,
* it is set to the default projection specified in the map,
* when the layer is added to the map.
* Projection along with default maxExtent and resolutions
* are set automatically with commercial baselayers in EPSG:3857,
* such as Google, Bing and OpenStreetMap, and do not need to be specified.
* Otherwise, if specifying projection, also set maxExtent,
* maxResolution or resolutions as appropriate.
* When using vector layers with strategies, layer projection should be set
* to the projection of the source data if that is different from the map default.
*/
projection: Projection;
/**
* The layer map units. Defaults to null. Possible values
* are 'degrees' (or 'dd'), 'm', 'ft', 'km', 'mi', 'inches'.
* Normally taken from the projection.
* Only required if both map and layers do not define a projection,
* or if they define a projection which does not define units.
*/
units: string;
/**
* An array of map scales in descending order. The values in the
* array correspond to the map scale denominator. Note that these
* values only make sense if the display (monitor) resolution of the
* client is correctly guessed by whomever is configuring the
* application. In addition, the units property must also be set.
* Use <resolutions> instead wherever possible.
*/
scales: any[];
/**
* A list of map resolutions (map units per pixel) in descending
* order. If this is not set in the layer constructor, it will be set
* based on other resolution related properties (maxExtent,
* maxResolution, maxScale, etc.).
*/
resolutions: any[];
/**
* The maximum extent for the layer. Defaults to null.
*/
maxExtent: Bounds;
/**
* The minimum extent for the layer. Defaults to null.
*/
minExtent: Bounds;
/**
* Default max is 360 deg / 256 px, which corresponds to
* zoom level 0 on gmaps. Specify a different value in the layer
* options if you are not using the default <OpenLayers.Map.tileSize>
* and displaying the whole world.
*/
maxResolution: number;
/**
*
*/
minResolution: number;
/**
*
*/
numZoomLevels: number;
/**
*
*/
minScale: number;
/**
*
*/
maxScale: number;
/**
* Request map tiles that are completely outside of the max
* extent for this layer. Defaults to false.
*/
displayOutsideMaxExtent: boolean;
/**
* Wraps the world at the international dateline, so the map can
* be panned infinitely in longitudinal direction. Only use this on the
* base layer, and only if the layer's maxExtent equals the world bounds.
*/
wrapDateLine: boolean;
/**
* This object can be used to store additional information on a
* layer object.
*/
metadata: Object;
/**
* Constructor: OpenLayers.Layer
*
* Parameters:
* name - {String} The layer name
* options - {Object} Hashtable of extra options to tag onto the layer
*/
constructor(name: string, options: LayerOptions);
/**
* Method: destroy
* Destroy is a destructor: this is to alleviate cyclic references which
* the Javascript garbage cleaner can not take care of on its own.
*
* Parameters:
* setNewBaseLayer - {Boolean} Set a new base layer when this layer has
* been destroyed. Default is true.
*/
destroy(setNewBaseLayer?: boolean): void;
/**
* Method: clone
*
* Parameters:
* obj - {<OpenLayers.Layer>} The layer to be cloned
*
* Returns:
* {<OpenLayers.Layer>} An exact clone of this <OpenLayers.Layer>
*/
clone(): Layer;
/**
* Method: getOptions
* Extracts an object from the layer with the properties that were set as
* options, but updates them with the values currently set on the
* instance.
*
* Returns:
* {Object} the <options> of the layer, representing the current state.
*/
private getOptions(): LayerOptions;
/**
* APIMethod: setName
* Sets the new layer name for this layer. Can trigger a changelayer event
* on the map.
*
* Parameters:
* newName - {String} The new name.
*/
setName(newName: string): void;
/**
* APIMethod: addOptions
*
* Parameters:
* newOptions - {Object}
* reinitialize - {Boolean} If set to true, and if resolution options of the
* current baseLayer were changed, the map will be recentered to make
* sure that it is displayed with a valid resolution, and a
* changebaselayer event will be triggered.
*/
addOptions(newOptions: LayerOptions, reinitialize: boolean): void;
/**
* This function can be implemented by subclasses
*/
onMapResize(): void;
/**
* APIMethod: redraw
* Redraws the layer. Returns true if the layer was redrawn, false if not.
*
* Returns:
* {Boolean} The layer was redrawn.
*/
redraw(): void;
/**
* Method: moveTo
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* zoomChanged - {Boolean} Tells when zoom has changed, as layers have to
* do some init work in that case.
* dragging - {Boolean}
*/
moveTo(bounds: Bounds, zoomChanged: boolean, dragging: boolean): void;
/**
* Method: moveByPx
* Move the layer based on pixel vector. To be implemented by subclasses.
*
* Parameters:
* dx - {Number} The x coord of the displacement vector.
* dy - {Number} The y coord of the displacement vector.
*/
moveByPx(dx: number, dy: number): void;
/**
* Method: setMap
* Set the map property for the layer. This is done through an accessor
* so that subclasses can override this and take special action once
* they have their map variable set.
*
* Here we take care to bring over any of the necessary default
* properties from the map.
*
* Parameters:
* map - {<OpenLayers.Map>}
*/
setMap(map: Map): void;
/**
* Method: afterAdd
* Called at the end of the map.addLayer sequence. At this point, the map
* will have a base layer. To be overridden by subclasses.
*/
private afterAdd(): void;
/**
* APIMethod: removeMap
* Just as setMap() allows each layer the possibility to take a
* personalized action on being added to the map, removeMap() allows
* each layer to take a personalized action on being removed from it.
* For now, this will be mostly unused, except for the EventPane layer,
* which needs this hook so that it can remove the special invisible
* pane.
*
* Parameters:
* map - {<OpenLayers.Map>}
*/
removeMap(map: Map): void;
/**
* APIMethod: getImageSize
*
* Parameters:
* bounds - {<OpenLayers.Bounds>} optional tile bounds, can be used
* by subclasses that have to deal with different tile sizes at the
* layer extent edges (e.g. Zoomify)
*
* Returns:
* {<OpenLayers.Size>} The size that the image should be, taking into
* account gutters.
*/
getImageSize(bounds: Bounds): Size;
/**
* APIMethod: setTileSize
* Set the tile size based on the map size. This also sets layer.imageSize
* or use by Tile.Image.
*
* Parameters:
* size - {<OpenLayers.Size>}
*/
setTileSize(size: Size): void;
/**
* APIMethod: getVisibility
*
* Returns:
* {Boolean} The layer should be displayed (if in range).
*/
getVisibility(): boolean;
/**
* APIMethod: setVisibility
* Set the visibility flag for the layer and hide/show & redraw
* accordingly. Fire event unless otherwise specified
*
* Note that visibility is no longer simply whether or not the layer's
* style.display is set to "block". Now we store a 'visibility' state
* property on the layer class, this allows us to remember whether or
* not we *desire* for a layer to be visible. In the case where the
* map's resolution is out of the layer's range, this desire may be
* subverted.
*
* Parameters:
* visibility - {Boolean} Whether or not to display the layer (if in range)
*/
setVisibility(visibility: boolean): void;
/**
* APIMethod: display
* Hide or show the Layer. This is designed to be used internally, and
* is not generally the way to enable or disable the layer. For that,
* use the setVisibility function instead..
*
* Parameters:
* display - {Boolean}
*/
display(display: boolean): void;
/**
* APIMethod: calculateInRange
*
* Returns:
* {Boolean} The layer is displayable at the current map's current
* resolution. Note that if 'alwaysInRange' is true for the layer,
* this function will always return true.
*/
calculateInRange(): boolean;
/**
* APIMethod: setIsBaseLayer
*
* Parameters:
* isBaseLayer - {Boolean}
*/
setIsBaseLayer(isBaseLayer: boolean): void;
/********************************************************/
/* */
/* Baselayer Functions */
/* */
/********************************************************/
/**
* Method: initResolutions
* This method's responsibility is to set up the 'resolutions' array
* for the layer -- this array is what the layer will use to interface
* between the zoom levels of the map and the resolution display
* of the layer.
*
* The user has several options that determine how the array is set up.
*
* For a detailed explanation, see the following wiki from the
* openlayers.org homepage:
* http://trac.openlayers.org/wiki/SettingZoomLevels
*/
initResolutions(): void;
/**
* Method: resolutionsFromScales
* Derive resolutions from scales.
*
* Parameters:
* scales - {Array(Number)} Scales
*
* Returns
* {Array(Number)} Resolutions
*/
private resolutionsFromScales(scales: number[]): number[];
/**
* Method: calculateResolutions
* Calculate resolutions based on the provided properties.
*
* Parameters:
* props - {Object} Properties
*
* Returns:
* {Array({Number})} Array of resolutions.
*/
calculateResolutions(props: Object): number[];
/**
* APIMethod: getResolution
*
* Returns:
* {Float} The currently selected resolution of the map, taken from the
* resolutions array, indexed by current zoom level.
*/
getResolution(): number;
/**
* APIMethod: getExtent
*
* Returns:
* {<OpenLayers.Bounds>} A Bounds object which represents the lon/lat
* bounds of the current viewPort.
*/
getExtent(): Bounds;
/**
* APIMethod: getZoomForExtent
*
* Parameters:
* extent - {<OpenLayers.Bounds>}
* closest - {Boolean} Find the zoom level that most closely fits the
* specified bounds. Note that this may result in a zoom that does
* not exactly contain the entire extent.
* Default is false.
*
* Returns:
* {Integer} The index of the zoomLevel (entry in the resolutions array)
* for the passed-in extent. We do this by calculating the ideal
* resolution for the given extent (based on the map size) and then
* calling getZoomForResolution(), passing along the 'closest'
* parameter.
*/
getZoomForExtent(extent: Bounds, closest?: boolean): number;
/**
* Method: getDataExtent
* Calculates the max extent which includes all of the data for the layer.
* This function is to be implemented by subclasses.
*
* Returns:
* {<OpenLayers.Bounds>}
*/
private getDataExtent(): Bounds;
/**
* APIMethod: getResolutionForZoom
*
* Parameters:
* zoom - {Float}
*
* Returns:
* {Float} A suitable resolution for the specified zoom.
*/
getResolutionForZoom(zoom: number): number;
/**
* APIMethod: getZoomForResolution
*
* Parameters:
* resolution - {Float}
* closest - {Boolean} Find the zoom level that corresponds to the absolute
* closest resolution, which may result in a zoom whose corresponding
* resolution is actually smaller than we would have desired (if this
* is being called from a getZoomForExtent() call, then this means that
* the returned zoom index might not actually contain the entire
* extent specified... but it'll be close).
* Default is false.
*
* Returns:
* {Integer} The index of the zoomLevel (entry in the resolutions array)
* that corresponds to the best fit resolution given the passed in
* value and the 'closest' specification.
*/
getZoomForResolution(resolution: number, closest?: boolean): number;
/**
* APIMethod: getLonLatFromViewPortPx
*
* Parameters:
* viewPortPx - {<OpenLayers.Pixel>|Object} An OpenLayers.Pixel or
* an object with a 'x'
* and 'y' properties.
*
* Returns:
* {<OpenLayers.LonLat>} An OpenLayers.LonLat which is the passed-in
* view port <OpenLayers.Pixel>, translated into lon/lat by the layer.
*/
getLonLatFromViewPortPx(viewPortPx: Pixel): LonLat;
/**
* APIMethod: getViewPortPxFromLonLat
* Returns a pixel location given a map location. This method will return
* fractional pixel values.
*
* Parameters:
* lonlat - {<OpenLayers.LonLat>|Object} An OpenLayers.LonLat or
* an object with a 'lon'
* and 'lat' properties.
*
* Returns:
* {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which is the passed-in
* lonlat translated into view port pixels.
*/
getViewPortPxFromLonLat(lonlat: LonLat, resolution: number): Pixel;
/**
* APIMethod: setOpacity
* Sets the opacity for the entire layer (all images)
*
* Parameters:
* opacity - {Float}
*/
setOpacity(opacity: number): void;
/**
* Method: getZIndex
*
* Returns:
* {Integer} the z-index of this layer
*/
getZIndex(): number;
/**
* Method: setZIndex
*
* Parameters:
* zIndex - {Integer}
*/
setZIndex(zIndex: number): void;
/**
* Method: adjustBounds
* This function will take a bounds, and if wrapDateLine option is set
* on the layer, it will return a bounds which is wrapped around the
* world. We do not wrap for bounds which *cross* the
* maxExtent.left/right, only bounds which are entirely to the left
* or entirely to the right.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
*/
adjustBounds(bounds: Bounds): Bounds;
static CLASS_NAME: string;
}
export class Marker {
// TODO
}
export class Popup {
// TODO
}
export class Protocol {
// TODO
}
export class Renderer {
// TODO
}
export class Request {
// TODO
}
export class Rule {
// TODO
}
export class SingleFile {
// TODO
}
export class Spherical {
// TODO
}
export class Strategy {
// TODO
}
export class Style {
// TODO
}
export class Style2 {
// TODO
}
export class StyleMap {
// TODO
}
export class Symbolizer {
// TODO
}
export class Tile {
// TODO
}
export class TileManager {
// TODO
}
export class Tween {
// TODO
}
export class Util {
// TODO
}
export class WPSClient {
// TODO
}
export class WPSProcess {
// TODO
}
export class Geometry {
/**
* A unique identifier for this geometry.
*/
id: string;
/**
* This is set when a Geometry is added as component
* of another geometry
*/
parent: Geometry;
/**
* The bounds of this geometry
*/
bounds: Bounds;
/**
* A Geometry is a description of a geographic object.
*/
constructor();
/**
* Destroy this geometry.
*/
destroy(): void;
/**
* Create a clone of this geometry. Does not set any non-standard properties of the cloned geometry.
*/
clone(): Geometry;
/**
* Set the bounds for this Geometry.
*/
setBounds(bounds: Bounds): void;
/**
* Nullify this components bounds and that of its parent as well.
*/
clearBounds(): void;
/**
* Extend the existing bounds to include the new bounds.
* If geometry's bounds is not yet set, then set a new Bounds.
*/
extendBounds(newBounds: Bounds): void;
/**
* Get the bounds for this Geometry. If bounds is not set, it is calculated again, this makes queries faster.
*/
getBounds(): Bounds;
/**
* Calculate the closest distance between two geometries (on the x-y plane).
*/
distanceTo(geometry: Geometry, options: Object): Object;
/**
* Return a list of all points in this geometry.
*/
getVertices(nodes: boolean): any[];
/**
* Return whether or not the geometry is at the specified location
*/
atPoint(lonlat: LonLat, toleranceLon?: number, toleranceLat?: number): boolean;
/**
* Returns the length of the collection by summing its parts
*/
getLength(): number;
/**
* Returns the area of the collection by summing its parts
*/
getArea(): number;
/**
* Returns a text representation of the geometry. If the WKT format is
* included in a build, this will be the Well-Known Text
* representation.
*/
toString(): string;
/**
* Calculate the centroid of this geometry. This method is defined in subclasses.
*/
getCentroid(): Geometry.Point;
static CLASS_NAME: string;
}
export class Projection {
/**
* This class offers several methods for interacting with a wrapped pro4js projection object.
*/
constructor(projCode: string, options?: any);
/**
* Get the string SRS code.
*/
getCode(): string;
/**
* Get the units string for the projection -- returns null if proj4js is not available.
*/
getUnits(): string;
/**
* Set a custom transform method between two projections. Use this method in cases where the proj4js lib is not available or where custom projections need to be handled.
*/
addTransform(from: string, to: string, method: () => void): void;
/**
* Transform a point coordinate from one projection to another. Note that the input point is transformed in place.
*/
transform(point: Geometry.Point, source: Projection, dest: OpenLayers.Projection): Object;
/**
* Transform a point coordinate from one projection to another. Note that the input point is transformed in place.
*/
transform(point: Object, source: Projection, dest: OpenLayers.Projection): Object;
/**
* A null transformation useful for defining projection aliases when proj4js is not available:
*/
nullTransform(point: Object): Function;
}
export class Bounds {
/**
* Minimum horizontal coordinate.
*/
left: number;
/**
* Minimum vertical coordinate.
*/
bottom: number;
/**
* Maximum horizontal coordinate.
*/
right: number;
/**
* Maximum vertical coordinate.
*/
top: number;
/**
* Construct a new bounds object. Coordinates can either be passed as four
* arguments, or as a single argument.
*/
constructor(left: number, bottom: number, right: number, top: number);
/**
* Construct a new bounds object. Coordinates can either be passed as four
* arguments, or as a single argument.
*/
constructor(bounds: number[]);
/**
* Create a cloned instance of this bounds.
*/
clone(): Bounds;
/**
* Test a two bounds for equivalence.
*/
equals(bounds: Bounds): boolean;
/**
* Returns a string representation of the bounds object.
*/
toString(): string;
/**
* Returns an array representation of the bounds object.
*/
toArray(reverseAxisOrder?: boolean): number[];
/**
* Returns a boundingbox-string representation of the bounds object.
*/
toBBOX(decimal?: number, reverseAxisOrder?: boolean): string;
/**
* Create a new polygon geometry based on this bounds.
*/
toGeometry(): OpenLayers.Geometry.Polygon;
/**
* Returns the width of the bounds.
*/
getWidth(): number;
/**
* Returns the height of the bounds.
*/
getHeight(): number;
/**
*
*/
getSize(): Size;
/**
* Returns the Pixel object which represents the center of the bounds.
*/
getCenterPixel(): Pixel;
/**
* Returns the LonLat object which represents the center of the bounds.
*/
getCenterLonLat(): LonLat;
/**
* Scales the bounds around a pixel or lonlat. Note that the new
* bounds may return non-integer properties, even if a pixel
* is passed.
*/
scale(ratio: number, origin?: Pixel): void;
/**
* Scales the bounds around a pixel or lonlat. Note that the new
* bounds may return non-integer properties, even if a pixel
* is passed.
*/
scale(ratio: number, origin?: LonLat): void;
/**
* Shifts the coordinates of the bound by the given horizontal and vertical
* deltas.
*/
add(x: number, y: number): Bounds;
/**
* Extend the bounds.
*/
extend(object: LonLat): void;
/**
* Extend the bounds.
*/
extend(object: Geometry.Point): void;
/**
* Extend the bounds.
*/
extend(object: Bounds): void;
/**
*
*/
extendXY(x: number, y: number): void;
/**
* Returns whether the bounds object contains the given <OpenLayers.LonLat>.
*/
containsLonLat(ll: LonLat, options: BoundsOptions): boolean;
/**
* Returns whether the bounds object contains the given <OpenLayers.LonLat>.
*/
containsLonLat(ll: Object, options: BoundsOptions): boolean;
/**
* Returns whether the bounds object contains the given <OpenLayers.Pixel>.
*/
containsPixel(px: Pixel, inclusive: boolean): boolean;
/**
* Returns whether the bounds object contains the given x and y.
*/
contains(x: number, y: number, inclusive?: boolean): boolean;
/**
* Determine whether the target bounds intersects this bounds. Bounds are
* considered intersecting if any of their edges intersect or if one
* bounds contains the other.
*/
intersectsBounds(bounds: Bounds, options: BoundsOptions): boolean;
/**
* Returns whether the bounds object contains the given <OpenLayers.Bounds>.
*/
containsBounds(bounds: Bounds, partial: boolean, inclusive: boolean): boolean;
/**
* Returns the the quadrant ("br", "tr", "tl", "bl") in which the given
*<OpenLayers.LonLat> lies.
*/
determineQuadrant(lonlat: LonLat): string;
/**
* Transform the Bounds object from source to dest.
*/
transform(source: Projection, dest: Projection): Bounds;
/**
* Wraps the bounds object around the dateline.
*/
wrapDateLine(maxExtent: Bounds, options: WrapDateLineOptions): Bounds;
static CLASS_NAME: string;
/**
* Alternative constructor that builds a new OpenLayers.Bounds from a
* parameter string.
*/
static fromString(str: string, reverseAxisOrder: boolean): Bounds;
/**
* Alternative constructor that builds a new OpenLayers.Bounds from an array.
*/
static fromArray(bbox: number[], reverseAxisOrder: boolean): Bounds;
/**
* Alternative constructor that builds a new OpenLayers.Bounds from a size.
*/
static fromSize(size: Size): Bounds;
/**
* Get the opposite quadrant for a given quadrant string.
*/
static oppositeQuadrant(quadrant: string): string;
}
export class LonLat {
/**
* Create a new map location. Coordinates can be passed either as two arguments, or as a single argument.
*/
constructor(lon: number, lat: number);
/**
* Create a new map location. Coordinates can be passed either as two arguments, or as a single argument.
*/
constructor(lonlat: number[]);
/**
* Shortened String representation of OpenLayers.LonLat object.
*/
toShortString(): string;
/**
* New OpenLayers.LonLat object with the same lon and lat values
*/
clone(): LonLat;
/**
* A new OpenLayers.LonLat object with the lon and lat passed-in added to this’s.
*/
add(lon: number, lat: number): LonLat;
/**
* Boolean value indicating whether the passed-in OpenLayers.LonLat object has the same lon and lat components as this. Note: if ll passed in is null, returns false.
*/
equals(ll: LonLat): boolean;
/**
* Transform the LonLat object from source to dest. This transformation is in place: if you want a new lonlat, use .clone() first.
*/
transform(source: Projection, dest: Projection): LonLat;
/**
* Returns a copy of this lonlat, but wrapped around the "dateline" (as specified by the borders of maxExtent).
*/
wrapDateLine(maxExtend: Bounds): LonLat;
}
export class Map {
/**
* Unique identifier for the map
*/
id: string;
/**
* For a base layer that supports it, allow the map resolution
* to be set to a value between one of the values in the resolutions
* array. Default is false.
*/
fractionalZoom: boolean;
/**
* An events object that handles all
* events on the map
*/
events: Events;
/**
* Allow the map to function with "overlays" only. Defaults to
* false. If true, the lowest layer in the draw order will act as
* the base layer. In addition, if set to true, all layers will
* have isBaseLayer set to false when they are added to the map.
*/
allOverlays: boolean;
/**
* The element that contains the map (or an id for that element).
*/
div: Object;
/**
* The map is currently being dragged.
*/
dragging: boolean;
/**
* Size of the main div (this.div)
*/
size: Size;
/**
* The element that represents the map viewport
*/
viewPortDiv: HTMLDivElement;
/**
* The lonlat at which the later container was re-initialized (on-zoom)
*/
layerContainerOrigin: LonLat;
/**
* The element that contains the layers.
*/
layerContainerDiv: HTMLDivElement;
/**
* Ordered list of layers in the map
*/
layers: Layer[];
/**
* List of controls associated with the map.
*/
controls: Control[];
/**
* List of popups associated with the map
*/
popups: Popup[];
/**
* The currently selected base layer. This determines
* min/max zoom level, projection, etc.
*/
baseLayer: Layer;
/**
* The current center of the map
*/
center: LonLat;
/**
* The resolution of the map.
*/
resolution: number;
/**
* The current zoom level of the map
*/
zoom: number;
/**
* The ratio of the current extent within which panning will tween.
*/
panRatio: number;
/**
* The options object passed to the class constructor. Read-only.
*/
options: Object;
/**
* Set in the map options to override the default tile size for this map.
*/
tileSize: Size;
/**
* Set in the map options to specify the default projection
* for layers added to this map. When using a projection other than EPSG:4326
* (CRS:84, Geographic) or EPSG:3857 (EPSG:900913, Web Mercator),
* also set maxExtent, maxResolution or resolutions. Default is "EPSG:4326".
* Note that the projection of the map is usually determined
* by that of the current baseLayer (see <baseLayer> and <getProjectionObject>).
*/
projection: string;
/**
* The map units. Possible values are 'degrees' (or 'dd'), 'm',
* 'ft', 'km', 'mi', 'inches'. Normally taken from the projection.
* Only required if both map and layers do not define a projection,
* or if they define a projection which does not define units
*/
units: string;
/**
* A list of map resolutions (map units per pixel) in
* descending order. If this is not set in the layer constructor, it
* will be set based on other resolution related properties
* (maxExtent, maxResolution, maxScale, etc.).
*/
resolutions: number[];
/**
* Required if you are not displaying the whole world on a tile
* with the size specified in <tileSize>.
*/
maxResolution: number;
/**
* APIProperty: minResolution
* {Float}
*/
minResolution: number;
/**
* APIProperty: maxScale
* {Float}
*/
maxScale: number;
/**
* APIProperty: minScale
* {Float}
*/
minScale: number;
/**
* APIProperty: maxExtent
* {<OpenLayers.Bounds>|Array} If provided as an array, the array
* should consist of four values (left, bottom, right, top).
* The maximum extent for the map.
* Default depends on projection; if this is one of those defined in OpenLayers.Projection.defaults
* (EPSG:4326 or web mercator), maxExtent will be set to the value defined there;
* else, defaults to null.
* To restrict user panning and zooming of the map, use <restrictedExtent> instead.
* The value for <maxExtent> will change calculations for tile URLs.
*/
maxExtent: Bounds;
/**
* APIProperty: minExtent
* {<OpenLayers.Bounds>|Array} If provided as an array, the array
* should consist of four values (left, bottom, right, top).
* The minimum extent for the map. Defaults to null.
*/
minExtent: Bounds;
/**
* APIProperty: restrictedExtent
* Limit map navigation to this extent where possible.
* If a non-null restrictedExtent is set, panning will be restricted
* to the given bounds. In addition, zooming to a resolution that
* displays more than the restricted extent will center the map
* on the restricted extent. If you wish to limit the zoom level
* or resolution, use maxResolution.
*/
restrictedExtent: Bounds;
/**
* APIProperty: numZoomLevels
* {Integer} Number of zoom levels for the map. Defaults to 16. Set a
* different value in the map options if needed.
*/
numZoomLevels: number;
/**
* APIProperty: theme
* {String} Relative path to a CSS file from which to load theme styles.
* Specify null in the map options (e.g. {theme: null}) if you
* want to get cascading style declarations - by putting links to
* stylesheets or style declarations directly in your page.
*/
theme: string;
/**
* APIProperty: displayProjection
* {<OpenLayers.Projection>} Requires proj4js support for projections other
* than EPSG:4326 or EPSG:900913/EPSG:3857. Projection used by
* several controls to display data to user. If this property is set,
* it will be set on any control which has a null displayProjection
* property at the time the control is added to the map.
*/
displayProjection: Projection;
/**
* APIProperty: