@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2016 Microsoft Corporation. All rights reserved.
+ * Copyright(c) 2017 Microsoft Corporation. All rights reserved.
*
* This code is licensed under the MIT License (MIT).
*
@@ -198,8 +198,10 @@ declare module Microsoft.Maps {
/** Represents the options that can be used when initializing a custom overlay. **/
export interface ICustomOverlayOptions {
/**
- * Specifies if the custom overlay should eb rendered above or below the label layer of the map. When above,
+ * Specifies if the custom overlay should be rendered above or below the label layer of the map. When above,
* elements in the overlay can be clickable. Default: True
+ *
+ * This can only be set when creating the overlay.
*/
beneathLabels? : boolean ;
}
@@ -209,6 +211,11 @@ declare module Microsoft.Maps {
/** Clears all data in the layer. */
clear(): void ;
}
+
+ /** A standard dictionary object (associative array). */
+ export interface IDictionary <T > {
+ [K : string ]: T ;
+ }
/** Event args included in entity collection events. */
export interface IEntityCollectionChangedEventArgs {
@@ -219,6 +226,29 @@ declare module Microsoft.Maps {
data: IPrimitive ;
}
+ /**
+ * The options that specify how to render a ground overlay on the map.
+ */
+ export interface IGroundOverlayOptions extends ICustomOverlayOptions {
+ /** A background color that fills the bounding box area beneath the ground overlay. */
+ backgroundColor? : string | Color ;
+
+ /** The bounding box to anchor the ground overlay to. This is required when creating a ground overlay. */
+ bounds? : LocationRect ;
+
+ /** The URL to the image to anchor to the map as a ground overlay. This is required when creating a ground overlay. */
+ imageUrl? : string ;
+
+ /** The opacity of the ground overlay image. */
+ opacity? : number ;
+
+ /** An angle in degrees to rotate the overlay in a counter-clockwise direction where 0 = north, 90 = west, 180 = south, 270 = east */
+ rotation? : number ;
+
+ /** A boolean value indicating if the ground overlay is visible or not. */
+ visible? : boolean ;
+ }
+
/** An object the identifies an event that has been attached to an object. */
export interface IHandlerId {
}
@@ -324,6 +354,9 @@ declare module Microsoft.Maps {
/** The type of the object that fired the event.This will always be 'infobox'. **/
targetType: string ;
+
+ /** Original mouse event from the browser. */
+ originalEvent? : MouseEvent ;
}
/** Map or View options */
@@ -352,9 +385,9 @@ declare module Microsoft.Maps {
/** Custom map styles used to modify the look and feel of the base map. */
customMapStyle? : ICustomMapStyle ;
-
- /** A boolean value indicating whether to disable the user’s ability to change the map type through the keyboard. Default: false */
- disableMapTypeKeyboardInput ? : boolean ;
+
+ /** A boolean value indicating whether to disable the user’s ability to control the using the keyboard. Default: false */
+ disableKeyboardInput ? : boolean ;
/** A boolean value indicating if mousing over the map type selector should open it or not. Default: true */
disableMapTypeSelectorMouseOver? : boolean ;
@@ -540,6 +573,9 @@ declare module Microsoft.Maps {
/** The type of the object that the event is attached to. Valid values include the following: ‘map’, 'layer', ‘polygon’, ‘polyline’, or ‘pushpin’ */
targetType: string ;
+ /** The number of units that the mouse wheel has changed. */
+ wheelDelta: number ;
+
/**
* Returns the x-value of the pixel coordinate, relative to the map, of the mouse.
* @returns The x-value of the pixel coordinate, relative to the map, of the mouse.
@@ -754,7 +790,7 @@ declare module Microsoft.Maps {
downloadTimeout? : number ;
/** The tile source for the tile layer. */
- mercator: TileSource ;
+ mercator? : TileSource ;
/** The opacity of the tile layer, defined by a number between 0 (not visible) and 1. */
opacity? : number ;
@@ -1104,11 +1140,11 @@ declare module Microsoft.Maps {
* Attaches the handler for the event that is thrown by the target. Use the return object to remove the handler using the removeHandler method.
* @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc.
* @param eventName The type of event to attach. Supported events:
- * click, dblclick, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
+ * click, dblclick, mapresize, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
* @param handler The callback function to handle the event when triggered.
* @returns The handler id.
*/
- export function addHandler(target : Map , eventName : string , handler : (eventArg ? : IMouseEventArgs | IMapTypeChangeEventArgs ) => void ): IHandlerId ;
+ export function addHandler(target : Map , eventName : string , handler : (eventArg ? : IMouseEventArgs | IMapTypeChangeEventArgs ) => void ): IHandlerId ;
/**
* Attaches the handler for the event that is thrown by the target. Use the return object to remove the handler using the removeHandler method.
@@ -1178,7 +1214,7 @@ declare module Microsoft.Maps {
* Attaches the handler for the event that is thrown by the target, but only triggers the handler the first once after being attached.
* @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc.
* @param eventName The type of event to attach. Supported events:
- * click, dblclick, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
+ * click, dblclick, mapresize, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
* @param handler The callback function to handle the event when triggered.
*/
export function addOne(target : Map , eventName : string , handler : (eventArg ? : IMouseEventArgs | IMapTypeChangeEventArgs ) => void ): void ;
@@ -1245,7 +1281,7 @@ declare module Microsoft.Maps {
* Attaches the handler for the event that is thrown by the target, where the minimum interval between events (in milliseconds) is specified as a parameter.
* @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc.
* @param eventName The type of event to attach. Supported events:
- * click, dblclick, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
+ * click, dblclick, mapresize, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart
* @param handler The callback function to handle the event when triggered.
* @param throttleInterval throttle interval (in ms)
* @returns The handler id.
@@ -1345,6 +1381,92 @@ declare module Microsoft.Maps {
}
/**
+ * A map overlay that binds an image to a bounding box area on the map.
+ */
+ class GroundOverlay extends CustomOverlay {
+
+ /** Optional property to store any additional metadata for this layer. */
+ metadata: any ;
+
+ /**
+ * @constructor
+ * @param options The options used to render the ground overlay.
+ */
+ constructor (options : IGroundOverlayOptions );
+
+ /**
+ * Gets the background color of the ground overlay.
+ * @returns The background color of the ground overlay.
+ */
+ public getBackgroundColor(): string | Color ;
+
+ /**
+ * Gets the bounding box that the ground overlay is bounded to.
+ * @returns The bounding box that the ground overlay is bounded to.
+ */
+ public getBounds(): LocationRect ;
+
+ /**
+ * Gets the url to the ground overlay image.
+ * @returns The url to the ground overlay image.
+ */
+ public getImageUrl(): string ;
+
+ /**
+ * Gets the opacity of the ground overlay.
+ * @returns The opacity of the ground overlay.
+ */
+ public getOpacity(): number ;
+
+ /**
+ * Gets the map that this overlay is attached to.
+ * @returns The map that this overlay is attached to.
+ */
+ public getMap(): Map ;
+
+ /**
+ * Gets the rotation of the ground overlay.
+ * @returns The rotation of the ground overlay.
+ */
+ public getRotation(): number ;
+
+ /**
+ * Gets a boolean indicating if the ground overlay is visible or not.
+ * @returns A boolean indicating if the ground overlay is visible or not.
+ */
+ public getVisible(): boolean ;
+
+ /**
+ * Sets the options used to render the ground overlay.
+ * @param options The options used to render the ground overlay.
+ */
+ public setOptions(options : IGroundOverlayOptions ): void ;
+
+ /**
+ * Sets the visibility of the Ground Overlay.
+ * @param value A value indicating if the Ground Overlay should be displayed or not.
+ */
+ public setVisible(visible : boolean ): void ;
+ }
+
+ /**
+ * Standard compass headings; north, south, east, west.
+ */
+ export class Heading {
+ /** A heading pointing north, 0 degrees. */
+ static North: number ;
+
+ /** A heading pointing south, 180 degrees. */
+ static South: number ;
+
+ /** A heading pointing east, 90 degrees. */
+ static East: number ;
+
+ /** A heading pointing west, 270 degrees. */
+ static West: number ;
+ }
+
+ /**
* An infobox, also sometimes refer to as an info window or popup, is a simple panel that displays information over top the map. This is
* often used to display information linked to a location after clicking on a pushpin.
*/
@@ -1485,9 +1607,9 @@ declare module Microsoft.Maps {
* while also providing providing a performance benefit over manually looping through each shape and performing these tasks.
*/
export class Layer implements IDataLayer {
-
- /** A unique string to be used to identify the layer. */
- public id : string ;
+
+ /** Optional property to store any additional metadata for this layer. */
+ public metadata : any ;
/**
* @constructor
@@ -1573,7 +1695,7 @@ declare module Microsoft.Maps {
* The layers property of the map is a LayerCollection object and contains all the layers that have been added to the map.
* Note: This class is only exposed in the map.layers property. No other instance of this class can be created.
*/
- export class LayerCollection {
+ export class LayerCollection extends Array {
/** The number of layers in the collection. */
public length: number ;
@@ -1728,13 +1850,34 @@ declare module Microsoft.Maps {
static fromLocations(locations : Location []): LocationRect ;
/**
+ * Calculates the LocationRect for an indivudal shape or an array of shapes.
+ * @param shapes An indivudal shape or an array of shapes to calculate the LocationRect for.
+ * @returns A LocationRect for the shapes.
+ */
+ static fromShapes(shapes : IPrimitive | (IPrimitive | IPrimitive [])[]): LocationRect ;
+
+ /**
* Creates a LocationRect from a string with the following format: "north,west,south,east". North, west, south and east specify the coordinate number values.
* @param str A string that repsents a LocationRect with the format "north,west,south,east".
* @returns A LocationRect defined by the specified northern and southern latitudes and western and eastern longitudes for the rectangle boundaries that have been parsed by the string.
*/
static fromString(str : string ): LocationRect ;
/**
+ * A static function that merges two LocationRect to form a new LocationRect which represents the combined area of the two LocationRect objects.
+ * @param rect1 The first LocationRect to merge with the second LocationRect.
+ * @param rect2 The second LocationRect to merge with the first LocationRect.
+ * @returns A new LocationRect which represents the combined area of the two LocationRect objects.
+ */
+ static merge(rect1 : LocationRect , rect2 : LocationRect ): LocationRect ;
+
+ /**
+ * Scales the size of a LocationRect by multiplying the width and height properties by a percentage.
+ * @param percentage A percentage value to increase the size of the LocationRect by.
+ */
+ public buffer(percentage : number ): void ;
+
+ /**
* Gets a copy of the LocationRect object.
* @retruns A copy of the LocationRect object.
*/
@@ -1796,12 +1939,6 @@ declare module Microsoft.Maps {
public intersects(rect : LocationRect ): boolean ;
/**
- * Scales the size of a LocationRect by multiplying the width and height properties by a percentage.
- * @param percentage A percentage value to increase the size of the LocationRect by.
- */
- public inflate(percentage : number ): void ;
-
- /**
* If a LocationRect crosses the international date line, this method splits it into two LocationRect objects and returns them as an array.
* @returns An array of LocationRects, that are split by the international date line (-180/180 degrees longitude)
*/
@@ -2471,6 +2608,9 @@ declare module Microsoft.Maps {
/** Represents a tile layer that can be overlaid on top of the map. */
export class TileLayer implements ILayer {
+ /** Optional property to store any additional metadata for this layer. */
+ public metadata: any ;
+
/**
* @constructor
* @param options The options to use to define the tile layer.