This commit is contained in:
Ricky Brundritt 2018-01-09 15:43:56 -08:00
Родитель 2438ea1908
Коммит 825472e05c
9 изменённых файлов: 142 добавлений и 29 удалений

Просмотреть файл

@ -4,7 +4,6 @@ var map = new Microsoft.Maps.Map('#MyMap', {
credentials: 'Your Bing Maps Key'
});
var pushpins = <Microsoft.Maps.Pushpin[]>Microsoft.Maps.TestDataGenerator.getPushpins(10, this.map.getBounds());
var infobox = new Microsoft.Maps.Infobox(pushpins[0].getLocation(), { visible: false });
infobox.setMap(map);
@ -27,7 +26,6 @@ Microsoft.Maps.Events.addOne(pin, 'changed', (e: Microsoft.Maps.IPrimitiveChange
//e.sender => reference to the pushpin object that changed.
});
layer.add(pin);
map.layers.insert(layer);

Просмотреть файл

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Microsoft.BingMaps.V8.TypeScript</id>
<version>2.0.1</version>
<version>2.0.2</version>
<title>Bing Maps V8 TypeScript Definitions</title>
<authors>Microsoft</authors>
<owners>microsoft bingmaps</owners>
@ -32,6 +32,7 @@
<file src="..\types\MicrosoftMaps\Modules\SpatialMath.d.ts" target="content\types\MicrosoftMaps\Modules\SpatialMath.d.ts" />
<file src="..\types\MicrosoftMaps\Modules\Traffic.d.ts" target="content\types\MicrosoftMaps\Modules\Traffic.d.ts" />
<file src="..\types\MicrosoftMaps\Modules\WellKnownText.d.ts" target="content\types\MicrosoftMaps\Modules\WellKnownText.d.ts" />
<file src="..\types\MicrosoftMaps\ConfigurationDrivenMaps.d.ts" target="content\types\MicrosoftMaps\ConfigurationDrivenMaps.d.ts" />
<file src="..\types\MicrosoftMaps\CustomMapStyles.d.ts" target="content\types\MicrosoftMaps\CustomMapStyles.d.ts" />
<file src="..\types\MicrosoftMaps\Microsoft.Maps.All.d.ts" target="content\types\MicrosoftMaps\Microsoft.Maps.All.d.ts" />
<file src="..\types\MicrosoftMaps\Microsoft.Maps.d.ts" target="content\types\MicrosoftMaps\Microsoft.Maps.d.ts" />
@ -49,6 +50,7 @@
<file src="..\types\MicrosoftMaps\Modules\SpatialMath.d.ts" target="contentFiles\types\MicrosoftMaps\Modules\SpatialMath.d.ts" />
<file src="..\types\MicrosoftMaps\Modules\Traffic.d.ts" target="contentFiles\types\MicrosoftMaps\Modules\Traffic.d.ts" />
<file src="..\types\MicrosoftMaps\Modules\WellKnownText.d.ts" target="contentFiles\types\MicrosoftMaps\Modules\WellKnownText.d.ts" />
<file src="..\types\MicrosoftMaps\ConfigurationDrivenMaps.d.ts" target="contentFiles\types\MicrosoftMaps\ConfigurationDrivenMaps.d.ts" />
<file src="..\types\MicrosoftMaps\CustomMapStyles.d.ts" target="contentFiles\types\MicrosoftMaps\CustomMapStyles.d.ts" />
<file src="..\types\MicrosoftMaps\Microsoft.Maps.All.d.ts" target="contentFiles\types\MicrosoftMaps\Microsoft.Maps.All.d.ts" />
<file src="..\types\MicrosoftMaps\Microsoft.Maps.d.ts" target="contentFiles\types\MicrosoftMaps\Microsoft.Maps.d.ts" />

Просмотреть файл

@ -1,8 +1,8 @@
{
"name": "bingmaps",
"version": "2.0.1",
"version": "2.0.2",
"description": "These are the official TypeScript definitions for the Bing Maps V8 SDK. These can be used to provide intellisense and rich error detection to your IDE.",
"typings": "Microsoft.Maps.All.d.ts",
"typings": "types/MicrosoftMaps/Microsoft.Maps.All.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions.git"

102
types/MicrosoftMaps/ConfigurationDrivenMaps.d.ts поставляемый Normal file
Просмотреть файл

@ -0,0 +1,102 @@
/*
* Copyright(c) 2017 Microsoft Corporation. All rights reserved.
*
* This code is licensed under the MIT License (MIT).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/// <reference path="Microsoft.Maps.d.ts"/>
/// <reference path="Modules/GeoJSON.d.ts"/>
/// <reference path="Modules/GeoXml.d.ts"/>
declare module Microsoft.Maps {
//////////////////////////////////////////////
/// Interfaces
//////////////////////////////////////////////
/** GeoJson options to use when loading a GeoJson file. */
export interface IGeoJsonReadOptions {
/**
* If the GeoJSON file is hosted on a different domain, and CORS is not enabled, but does support JSONP,
* you will need to specify the name of JSONP URL parameter that can be used to download the file across different domains.
*/
jsonpQueryParam?: string,
/** An optional name to identify the layer by. */
layerName?: string,
/** The styles to apply to shapes that don't have a defined style in the XML. */
style?: IStylesOptions
}
/** Steps to execute after a module is loaded. */
export interface PostModuleAction {
/** A URL to load the data layer from. Currently supports data in GeoJSON, GeoRSS (with inline GML), GPX, KML, and KMZ formats. */
addLayerFromUrl: string,
/** Options to use when loading data via the GeoXml module. */
geoXmlOption?: IGeoXmlLayerOptions,
/** Options to use when loading data via the GeoJson module. */
geoJsonOption?: IGeoJsonReadOptions
}
/** Defines which module should be loaded, and the data sets that should be loaded with it. Currently supports the "Microsoft.Maps.GeoXml" and "Microsoft.Maps.GeoJson" modules.*/
export interface IConfigurableMapModule {
/** Name of the module to load. Supported values: "Microsoft.Maps.GeoXml", "Microsoft.Maps.GeoJson". */
moduleName: string,
/** A set of steps to execute after a module is loaded. */
moduleOptions: PostModuleAction | PostModuleAction[]
}
/**
* Configurable map definitionm includes initial options to load the map as well as a list of modules to load afterwards.
*/
export interface IConfigurableMapOptions {
/** Initial map options. */
mapOptions: IMapOptions,
/** List of configuration modules to load. */
modules: IConfigurableMapModule[]
}
//////////////////////////////////////////////
/// Classes
//////////////////////////////////////////////
/**
* The configuration driven map framework.
*/
export class ConfigurableMap {
/**
* A static function that loads a map using a JSON configuraiton file.
* @param element The parent element of the map as a CSS selector string or HTMLElement.
* @param configFileUrl The Url to download the JSON configuration file from. This should JSON file should contain a IConfigurableMapOptions object.
* @param withCredentials Creates the config file request with the setwithcredentials property.
* @param requestHeaders Set of headers that need to be added to config file request.
* @param callback Callback that is triggered when the map loads successfully.
* @param errorCallback Callback that is triggered when an error occurs when loading the map.
*/
public static createFromConfig(element: string | HTMLElement, configFileUrl: string, withCredentials: boolean, requestHeaders?: IDictionary<string>, callback?: (map: Map) => void, errorCallback?: (errorMsg: string) => void): void;
}
}

4
types/MicrosoftMaps/Microsoft.Maps.All.d.ts поставляемый
Просмотреть файл

@ -39,4 +39,6 @@
/// <reference path="Modules/SpatialDataService.d.ts"/>
/// <reference path="Modules/SpatialMath.d.ts"/>
/// <reference path="Modules/Traffic.d.ts"/>
/// <reference path="Modules/WellKnownText.d.ts"/>
/// <reference path="Modules/WellKnownText.d.ts"/>
/// <reference path="ConfigurationDrivenMaps.d.ts"/>

24
types/MicrosoftMaps/Microsoft.Maps.d.ts поставляемый
Просмотреть файл

@ -28,6 +28,11 @@
* The Bing Maps V8 developer API.
*/
declare module Microsoft.Maps {
/**
* The Bing Maps key used to load the map.
*/
export var Credentials: string;
//////////////////////////////////////////////
/// Enumerations
//////////////////////////////////////////////
@ -412,7 +417,7 @@ declare module Microsoft.Maps {
/**
* Scrolling the mouse wheel over the map will zoom it in or out, but will not scroll the page.
* Setting this property to true disables the zooming of the map and instead reverts back to scrolling the page instea.
* Setting this property to true disables the zooming of the map and instead reverts back to scrolling the page.
* Default: false
*/
disableScrollWheelZoom?: boolean;
@ -903,7 +908,7 @@ declare module Microsoft.Maps {
//////////////////////////////////////////////
/// Modular Framework
//////////////////////////////////////////////
/**
* Loads the specified registered module, making its functionality available. You can provide the name of a single module or an array of names in.
* Options or a callback function that is called when the module is loaded can be specified.
@ -929,6 +934,18 @@ declare module Microsoft.Maps {
* @param moduleName Name of the module that is loaded.
*/
export function moduleLoaded(moduleName: string): void;
//////////////////////////////////////////////
/// Static methods
//////////////////////////////////////////////
/**
* Checks to see if Birdseye imagery is available at a specified location and heading.
* @param loc The location to check for Birdseye imagery coverage.
* @param heading The heading of the imagery to check for. Default: 0.
* @param callback A callback function which recieves a boolean indicating if birdseye coverage is available in the specified location or not.
*/
export function getIsBirdseyeAvailable(loc: Location, heading: Heading | number, callback: (isAvailable: boolean) => void): void;
//////////////////////////////////////////////
/// Classes
@ -2015,8 +2032,7 @@ declare module Microsoft.Maps {
/** Returns the branch name; release, experimental, frozen. */
public static getVersion() : string;
/** Deletes the Map object and releases any associated resources. */
public dispose(): void;

18
types/MicrosoftMaps/Modules/DrawingTools.d.ts поставляемый
Просмотреть файл

@ -295,9 +295,6 @@ declare module Microsoft.Maps.DrawingTools {
* Values used to identify and enable the items shown in the drawing bar.
*/
export enum DrawingBarAction {
/** No action */
none,
/** Create point primitive */
point,
@ -307,12 +304,6 @@ declare module Microsoft.Maps.DrawingTools {
/** Create polygon primitive */
polygon,
/** Create ellipse primitive */
ellipse,
/** Create rectangle primitive */
rectangle6,
/** Erase existing primitive */
erase,
@ -325,15 +316,6 @@ declare module Microsoft.Maps.DrawingTools {
/** Change fill style */
fillStyle,
/** Set stroke line thickness */
lineThickness,
/** Set stroke dash style */
strokeDash,
/** Show debug menu */
debug,
/** All items */
all,

3
types/MicrosoftMaps/Modules/GeoXml.d.ts поставляемый
Просмотреть файл

@ -101,6 +101,9 @@ declare module Microsoft.Maps {
/** A boolean indicating if the layer is visible or not. Default: true */
visible?: boolean;
/** An optional name to identify the layer by. */
layerName?: string;
}
/**

Просмотреть файл

@ -203,8 +203,16 @@ declare module Microsoft.Maps.SpatialDataService {
* @param credentials A bing maps key or a map instance which can be used to provide credentials to access the data source. Note that the map will need
* 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.
* @param styles The polygon styling settings to apply to the boundary polygon.
* @param errorCallback A callback function to trigger when an error occurs when searching for a boundary.
*/
export function getBoundary(locations: string | Location | (string | Location)[], request: IGetBoundaryRequestOptions, credentials: string | Map, callback: (results: IGeoDataResultSet) => void, styles?: IPolygonOptions): void;
export function getBoundary(locations: string | Location | (string | Location)[],
request: IGetBoundaryRequestOptions,
credentials: string | Map,
callback: (results: IGeoDataResultSet) => void,
styles?: IPolygonOptions,
errorCallback?: (callbackState?: string | Location, networkStatus?: string) => void
): void;
}
//////////////////////////////////////////////