View
@@ -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.
View
@@ -228,8 +228,8 @@ declare module Microsoft.Maps.Directions {
/** A boolean indicating whether the maneuver image is a road shield image. */
isImageRoadShield: boolean;
- /** The name of the maneuver image. */
- maneuverImageName: string;
+ /** The type of maneuver being performed. */
+ maneuver: string;
/** An array of strings, where each string is a hint to help determine when to move to the next direction step. Not all direction steps have hints. */
postIntersectionHints: string[];
@@ -251,6 +251,27 @@ declare module Microsoft.Maps.Directions {
/** The name of the transit line end. */
transitTerminus: string;
+
+ /** An array of route warnings associated with this step. */
+ warnings: IDirectionsStepWarning[];
+ }
+
+ /** Represents a route direction warning, such as a traffic congestion warning. */
+ export interface IDirectionsStepWarning {
+ /** Where the warning starts. */
+ origin: string;
+
+ /** The severity of the warning. Values can be: Low Impact, Minor, Moderate, Serious or None. */
+ severity: string;
+
+ /** The warning text. */
+ text: string;
+
+ /** Where the warning ends. */
+ to: string;
+
+ /** The type of warning. A list of Warning type values can be found here: https://msdn.microsoft.com/en-us/library/hh441731.aspx */
+ warningType: string;
}
/** Represents a route. */
@@ -358,8 +379,7 @@ declare module Microsoft.Maps.Directions {
/** Options that can be used to define a waypoint. */
export interface IWaypointOptions {
/**
- * The address string, business name, or search string of the waypoint. For example, the following strings are valid for this parameter: “Seattle”,
- * “Microsoft”, “pizza”, or “pizza Seattle”. Either the address or location property must be specified.
+ * The address string of the waypoint. For example, the following strings are valid for this parameter: "Seattle", "1 Microsoft Way, Redmond, WA". Either the address or location property must be specified.
*/
address?: string;
View
@@ -34,6 +34,15 @@ declare module Microsoft.Maps {
/** The new drawing mode. **/
mode: DrawingTools.DrawingMode;
}
+
+ /** An object that contains options to change the settings of the drawing manager. */
+ export interface IDrawingManagerOptions {
+ /** The fill color used for pushpins and polygons. */
+ fill: string | Color;
+
+ /** The stroke color used for polylines and polygons. */
+ stroke: string | Color;
+ }
/**
* The DrawingManager class manages the ability to draw and edit multiple shapes on the map. Shapes managed by this class are rendered on a separate drawing layer.
@@ -97,6 +106,12 @@ declare module Microsoft.Maps {
* @param mode The drawing mode to set the DrawingManager to.
*/
setDrawingMode(mode: DrawingTools.DrawingMode): void;
+
+ /**
+ * Sets the drawing tool options.
+ * @param options The options to use with the drawing manager.
+ */
+ setOptions(options: IDrawingManagerOptions): void;
/**
* Replaces all shapes in the layer with the new array of shapes that have been provided.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -25,11 +25,6 @@
/// <reference path="../Microsoft.Maps.d.ts"/>
declare module Microsoft.Maps {
- /** A standard dictionary object (associative array). */
- export interface IDictionary<T> {
- [K: string]: T;
- }
-
/** Options for customizing how the heat map is rendered. */
export interface IHeatMapLayerOptions {
/**
View
@@ -29,26 +29,6 @@
* @requires The Microsoft.Maps.Search module.
*/
declare module Microsoft.Maps.Search {
- /**
- * Defines the match precision of a geocdoed result.
- * @requires The Microsoft.Maps.Search module.
- */
- export enum LocationPrecision {
- /** The geocode result was matched to a point on a road using interpolation. */
- interpolated,
-
- /**
- * The geocode result was matched to a point on a road using interpolation with an additional offset to shift the
- * Location to the side of the street.
- */
- InterpolatedOffset,
-
- /** The geocode result was matched to the center of a parcel (property boundary). */
- parcel,
-
- /** The geocode result was matched to the rooftop of a building. */
- rooftop
- }
/**
* Defines the geocoding level of the location match found by the geocoder.
@@ -89,16 +69,22 @@ declare module Microsoft.Maps.Search {
unknown
}
- /** A object that represents a geocoded location. */
+ /** An object that represents a geocoded location. */
export interface IGeocodeLocation {
- /** The map location of this geocode location match. */
- location: Location;
+ /** The latitude of the location. */
+ latitude: number;
+
+ /** The longitude of the location. */
+ longitude: number;
/** The name of this geocode location match. */
name: string;
- /** The precision of this geocode location match. */
- precision: string | LocationPrecision;
+ /**
+ * The precision of this geocode location match.
+ * Possible Values: Interpolated, InterpolatedOffset, Rooftop, Parcel
+ */
+ precision: string ;
}
/** An object that represents an place result. */
View
@@ -204,7 +204,7 @@ declare module Microsoft.Maps.SpatialDataService {
* to be loaded with a bing maps key that has access to the data source.
* @param callback A callback function to return the results to. If an array of locations are specified the callback function will be triggered for each location in the array.
*/
- export function getBoundary(locations: string | Location | (string | Location)[], request: IGetBoundaryRequestOptions, credentials: string | Map, callback: (results: IGeoDataResultSet) => void): void;
+ export function getBoundary(locations: string | Location | (string | Location)[], request: IGetBoundaryRequestOptions, credentials: string | Map, callback: (results: IGeoDataResultSet) => void, styles?: IPolygonOptions): void;
}
//////////////////////////////////////////////
@@ -414,7 +414,7 @@ declare module Microsoft.Maps.SpatialDataService {
queryUrl: string;
/** Specifies a conditional expression for a list of properties and values. */
- filter?: IFilter;
+ filter?: string | IFilter;
/** Specifies whether or not to return a count of the results in the response. Default: false */
inlineCount?: boolean;
@@ -457,6 +457,8 @@ declare module Microsoft.Maps.SpatialDataService {
* @param credentials - Credentials for the query
* @param callback - The function to call once the results are retrieved
* @param styles - (Optional) Styles of the data that needs to be rendered on map
+ * @param withoutLocationInfo -
+ * @param errorCallback -
*/
export function search(queryOptions: IQueryAPIOptions,
credentials: string | Map,