Git Product home page Git Product logo

bing-maps-v8-typescript-definitions's Introduction

Bing Maps Logo

NuGet npm license

Bing Maps V8 TypeScript Definitions

These are the official TypeScript definitions for the Bing Maps V8 Web Control. These can be used to provide intellisense and richer error catching functionality to your IDE.

Bing Maps V8 Intellisense

Note: Due to popular demand, version 2.x now puts these definitions in a types folder instead of a scripts folder.

How to get the definitions

Use the NuGet Package

Using the Bing Maps V8 TypeScript Definitions NuGet package will make it easy to both add the definitions to your project and to also keep them up to date.

If using Visual Studio, open the nuget package manager, select the Browse tab and search for "Bing Maps V8". This should reduce the list of results enough to fine the "Bing Maps V8 TypeScript Definitions" package. The owner of the package is bingmaps.

Alternatively, if you are using the nuget commandline:

PM>  Install-Package Microsoft.BingMaps.V8.TypeScript

Install npm package

Using the Bing Maps V8 TypeScript npm package is another easy way to add the definitions to your project and keep them up to date.

npm install -g bingmaps

Download definitions

Simply press the download button for this repository. Unzip the downloaded file, and copy the types folder into your project. Note that you will need to do this process again from time to time if you want to have the most recent definitions. This should only be needed if you want to use newer features or if bugs in the definitions have been corrected.

Usage

If using Visual Studio, you can add a reference to the core Bing Maps V8 functionality by adding the following to the top of your TypeScript file.

/// <reference path="types/MicrosoftMaps/CustomMapStyles.d.ts" />
/// <reference path="types/MicrosoftMaps/Microsoft.Maps.d.ts" />

If you want to also use some of the Bing Maps modules, you can either update the above reference to the following:

/// <reference path="types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />

or you can add a reference to the individual module definitions.

Module Path
Autosuggest types/MicrosoftMaps/Modules/Autosuggest.d.ts
Clustering types/MicrosoftMaps/Modules/Clustering.d.ts
Contour types/MicrosoftMaps/Modules/Contour.d.ts
Data Binning types/MicrosoftMaps/Modules/DataBinning.d.ts
Directions types/MicrosoftMaps/Modules/Directions.d.ts
Drawing Tools types/MicrosoftMaps/Modules/DrawingTools.d.ts
GeoJSON types/MicrosoftMaps/Modules/GeoJson.d.ts
GeoXml types/MicrosoftMaps/Modules/GeoXml.d.ts
Heat Map Layer types/MicrosoftMaps/Modules/HeatMapLayer.d.ts
Search types/MicrosoftMaps/Modules/Search.d.ts
Spatial Data Services types/MicrosoftMaps/Modules/SpatialDataServices.d.ts
Spatial Math types/MicrosoftMaps/Modules/SpatialMath.d.ts
Traffic types/MicrosoftMaps/Modules/Traffic.d.ts
Well Known Text types/MicrosoftMaps/Modules/WellKnownText.d.ts

Note:

This project is just TypeScript definitions and not actual API code. You will need to add a script reference to the Bing Maps V8 Web Control in your application to load the functional API. For example:

<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap&key=[Your_Bing_Maps_Key]' async defer></script>

Screenshots

The following shows the intellisense for events. Notice how a list of the supported events are displayed, thus saving you from having to go back to documentation to verify the correct event name. Also notice how the structure of the event argument is known and you can easily access its properties.

Bing Maps V8 Event Intellisense

The following shows the intellisense for adding modules. A list of the supported modules appears, saving you from having to go looking for the correct name/spelling used in Bing Maps V8.

Bing Maps V8 Load Module Intellisense

Q & A

  • Q: When will new Bing Maps features be added to these definitions.
    • A: New features will be added to the definitions when they have graduated out of the experimental branch and into the main release branch of V8. This will often be done in parallel with MSDN documentation updates. A list of new features can be found in the release notes here.
  • Q: Whats the difference between version 1.x and 2.x?
    • A: Version one put all the definitions in a scripts folder while version 2.x adds them to a types folder.

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Related Projects

Additional Resources

License

MIT

See License for full license text.

bing-maps-v8-typescript-definitions's People

Contributors

craigermcgreger avatar deisterhold avatar kb3eua avatar microsoft-github-policy-service[bot] avatar msftgits avatar perfahlen avatar rbrundritt avatar vivienchevallier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bing-maps-v8-typescript-definitions's Issues

Add module export for Microsoft.Maps.d.ts

I want to do this....
import { Microsoft } from 'bingmaps/scripts/MicrosoftMaps/microsoft.maps';

but because you are not including an export on the module, I am not able to. Can we add explicit export statements to allow for greater integration with Typescript?

e.g.
change
"declare module Microsoft.Maps {"
to
"export declare module Microsoft.Maps {"

please also do so for all the files inside the "modules" folder... this will allow imports to be cleaner.

Thanks!

Property 'length' does not exist on type 'Pushpin | Pushpin[]

Hi, thas message appears with this code:

var pushpins = Microsoft.Maps.TestDataGenerator.getPushpins(10, this.map.getBounds()); var infobox = new Microsoft.Maps.Infobox(pushpins[0].getLocation(), { visible: false }); infobox.setMap(map); for (var i = 0; i < pushpins.length; i++) { ... }

Property 'length' does not exist on type 'Pushpin | Pushpin[]

Inside Microsoft.Maps.d.ts
Line --> export class Pushpin implements IPrimitive { ...
I have written the property
public length: number;

Now it works, but I supose that isn't the correct way to do it.

Microsoft.Maps.Directions.TimeType should be TimeTypes

Microsoft.Maps.Directions.TimeType enum is not available, because implementation is Microsoft.Maps.Directions.TimeTypes.

When I call DirectionManager#setRequestOptions with the TimeType enum, TypeError: Cannot read properties of undefined (reading 'xxx') happens.

Cannot read property

I am trying to use the SpatialMath class of the Bing Maps API, but when I try and use it below I am getting this error. "Uncaught TypeError: Cannot read propert of 'getHeading' of undefined.

`locs = this.generatePolylinePointsWithArrow(locs, numArrows, arrowLength);

// Finds the heading for the arrow that will be added at the center of the line
var midIdx = Math.floor(locs.length / 2);
var heading: any;
setTimeout(() => {
  
}, 2000)

heading = Microsoft.Maps.SpatialMath.getHeading(locs[midIdx], locs[midIdx + 1]);

// Create the arrow pushpin
var arrowPin = new Microsoft.Maps.Pushpin(locs[midIdx + 1], {
  icon: '<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32"><path d="M10.5 31 L16 16 21.5 31" style="stroke:#FFB500;stroke-width:2px;fill:none;" transform="rotate(' + heading + ', 16, 16)"/></svg>',//'../../../../../assets/Images/arrow.png',//'<img src="../../../../../assets/Images/arrow.png" transform="rotate(' + heading + ', 16, 16)"></img>',
  anchor: new Microsoft.Maps.Point(16, 16)
});`

I suspect this is because my file hasn't loaded SpatialMath yet, but I still don't know how to resolve this issue.

I have these two lines at the top of my file
/// <reference path="..\..\..\..\..\..\node_modules\bingmaps\scripts\MicrosoftMaps\Modules\SpatialMath.d.ts"/> /// <reference path="..\..\..\..\..\..\node_modules\bingmaps\scripts\MicrosoftMaps\Microsoft.Maps.d.ts"/>

IMapLoadOptions requires the deprecated field credentials

https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions/blob/master/types/MicrosoftMaps/Microsoft.Maps.d.ts#L365

export interface IMapLoadOptions extends IMapOptions, IViewOptions {
    /** The Bing Maps Key used to authenticate the application. This property can only be set when using the Map constructor. */
    credentials: string;
}

https://msdn.microsoft.com/en-us/library/mt712646.aspx

credentials string Deprecated. The Bing Maps Key used to authenticate the application. This property can only be set when using the Map constructor. It is recommended that the Bing Maps key be set as a URL parameter of the Bing Maps script reference as documented in the Setting Map Control Parameters document. This option will continue to work.

Bing Map Types missing types for other modules

In angular 4 and typescript 2.6 I am following your instructions to add type information.
But i get the following error: Property 'SpatialDataService' does not exist on type 'typeof Maps'. when trying to use the SpatialDataService module or any other modules.
In @types\BingMaps I dont see any type information on the other modules.

Addition the references also does not helps

/// <reference path="types/MicrosoftMaps/Microsoft.Maps.d.ts" />
/// <reference path="types/MicrosoftMaps/Modules/SpatialDataServices.d.ts" />

Please adivse

Thanks

this in CustomOverlay prototype methods

It is probably not only CustomOverlay problem but with all utilities doing similar staff, but in my case its CustomOverlay. It would be nice to be able to access the CustomOverlay members from this when inside constructional methods like onAdd, onLoad, onRemove...

Thank you.

Circular dependency between modules

A circular dependency exists in the top-level Microsoft.Maps module, which is dependent upon both the Directions and DrawingTools modules.

For my project I don't require either of these 2 child modules, but it won't compile without them b/c they're required by the Microsoft.Maps module:

/// <reference path="Modules/Directions.d.ts"/>
/// <reference path="Modules/DrawingTools.d.ts"/>

/**
 *  The Bing Maps V8 developer API.
 */
declare module Microsoft.Maps {
    /** A static class that manages events within the map SDK. */
    export class Events {
        /////////////////////////////////////
        /// addHandler Definitions
        ////////////////////////////////////

        /**
        * 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:
        * drawingChanged, drawingChanging, drawingEnded, drawingModeChanged, drawingStarted
        * @param handler The callback function to handle the event when triggered. 
        * @returns The handler id.
        */
        public static addHandler(target: DrawingTools, eventName: string, handler: (eventArg?: IPrimitive | IDrawingModeChangedData) => 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.
        * @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:
        * disposed, drawingChanged, drawingChanging, drawingEnded, drawingErased, drawingModeChanged, drawingStarted
        * @param handler The callback function to handle the event when triggered. 
        * @returns The handler id.
        */
        public static addHandler(target: DrawingManager, eventName: string, handler: (eventArg?: IPrimitive | DrawingTools.DrawingMode) => 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.
        * @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:
        * • directionsError
        * • directionsUpdated
        * @param handler The callback function to handle the event when triggered. 
        * @returns The handler id.
        */
        public static addHandler(target: Directions.DirectionsManager, eventName: string, handler: (eventArg?: Directions.IDirectionsEventArgs | Directions.IDirectionsErrorEventArgs) => void): IHandlerId;
    }
}

Rename GeoJSON.d.ts to GeoJson.d

Hi,

I've tested GeoJson functionality Microsoft.Maps.loadModule("Microsoft.Maps.GeoJson"). As soon as you rename file GeoJSON.d.ts to GeoJson.d (and references inside file JSON -> Json), that works perfectly.

Thanks for your work,
Javi

`typings` field points to wrong place

The package.json contains: typings": "Microsoft.Maps.All.d.ts",.
But the typings are actually in in types/Microsoft.Maps.All.d.ts.
This means that installing the package and adding /// <reference types="bingmaps" /> results in a compile error since TypeScript can't find the typings.
Fixing this would enable us to remove the duplicate declarations from DefinitelyTyped and defer to this package.

Definition output

All my TypeScript outputs are allmost all from DefinitelyTyped.
These definitions install in Scripts/typings.
but MicrosoftMaps installs the definitions in /Scripts.

now it is like this:

/
--/Scripts
----/MicrosoftMaps
----/typings
------/bootstrap
------/jquery
------/es6-shim

Make it like this!

/
--/Scripts
----/typings
------/bootstrap
------/jquery
------/es6-shim
------/MicrosoftMaps

When publishing asp.net mvc we only have to take care of one folder "typings".

P.S.: Move the package over to DefinitelyTyped

Screen reader is not announcing the location of markers on the map.

Environment Information
Package version(s): "@fluentui/react": "^8.45.0"
Browser and OS versions: Windows 10 20H2; Edge Version 96.0.1054.29 (Official build) (64-bit)
Screen Reader: Narrator

Describe the issue:
After open the BingMaps the screen reader doesn't announcing targeted location.

Expected behavior:
When BingMaps opened with one target location. The screen reader should announcing the target location address.

TypeScript Error - Cannot find name Microsoft

I followed the instructions provided in the website https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions . My Visual Studio Code is not showing any errors though I get the error "Cannot find name Microsoft" when I try to run my angular project.

I tried both methods and still get the below error.

  • Install npm package
  • Use DefinitelyTyped

I also tried to include the bingmaps in the package.json and that didn't work either.
Can someone please tell me what I am doing wrong?

Error:

error TS2304: Cannot find name 'Microsoft'.

Below is my code sample

var options = {maxResults: 5, businessSuggestions: true};
Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', function () {
var manager = new Microsoft.Maps.AutosuggestManager( options );
manager.attachAutosuggest('#searchBox', '#searchBoxContainer', suggestionSelected);
});

First attempt

/// <reference path="../../../../../../node_modules/bingmaps/types/MicrosoftMaps/CustomMapStyles.d.ts" />
/// <reference path="../../../../../../node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.d.ts" />
/// <reference path="../../../../../../node_modules/bingmaps/types/MicrosoftMaps/Modules/Autosuggest.d.ts" />

Second attempt

/// <reference path="../../../../../../node_modules/@types/bingmaps/index.d.ts" />
/// <reference path="../../../../../../node_modules/@types/bingmaps/Autosuggest.d.ts" />
/// <reference path="../../../../../../node_modules/@types/bingmaps/Clustering.d.ts" />

Environment Info

OS: Windows 10
Browser: Chrome 69.0.3497.92 (Official Build) (64-bit)
Angular: 5.1.0
TypeScript: 2.4.2

Error with Live V8 Code Samples Canvas Overlay

Looking at the Canvas Overlay sample from the Bing Maps sample code.

Getting an error loading the CanvasOverlayModule. The following is logged in the console:

GET http://bingmapsv8samples.azurewebsites.net/CanvasOverlayModule.js 
https://www.bing.com/rms/SDKPlugin/cj,nj/5dac24ae/265f75e7.js?bu=rms+answers+MapsSDKRelease+AnonymousBegin*SDKPluginStart*SDKInfoboxOverlay*Infobox*SDKColor*TileSource*TileLayer*Module*Layer*EntityCollection*Events*SDKPrimitiveTemplateSelector*UserMouseEventArgs*PixelReference*Pushpin*SDKPolygon*SDKPolyline*TestDataGenerator*CustomOverlay*GroundOverlay*AnimatedTileLayer*MapsTilePrimer*SDKMap*PointCompression*DeprecatedClass*SDKPluginEnd*AnonymousEnd

The canvas and pins aren't loading. This was working for me yesterday, looks like there was an update last night though.

Getting a similar error in my own code (using Bing Maps API w/ Webpack and Angular2), unsure what the error is here or how to debug. Please advise.

HeatMapLayer: Options: drawOrder property?

The documentation for the HeatMapLayer Options object defines a 'drawOrder' property, with which a z-index like value can be set to control layering. See documentation.
However the typescript definition (loaded through:
https://www.bing.com/api/maps/mapcontrol?callback=initBingMap&key=${ key }
) does not expose this field.
This may be the case, but what is the alternative for this field? I.e. how can i control the order or depth in which this layer is drawn?

Unable to compile with noImplicitAny set to true

When I try to compile with these definitions, I get the following errors:

ERROR in [default] C:/Projects/BingTest/typings/globals/Directions/index.d.ts:484:15 
'clearDisplay', which lacks return-type annotation, implicitly has an 'any' return type.
ERROR in [default] C:/Projects/BingTest/typings/globals/Directions/index.d.ts:487:15 
'dispose', which lacks return-type annotation, implicitly has an 'any' return type.
ERROR in [default] C:/Projects/BingTest/typings/globals/Microsoft.Maps/index.d.ts:970:15 
'clear', which lacks return-type annotation, implicitly has an 'any' return type.

This is because in my tsconfig.json file I've set:

{
  "compilerOptions": {
    "noImplicitAny": true
  }
}

If I set noImplicitAny to false then it compiles, but that's not what I want to use for my project.

When used in PowerBI got error window[Microsoft.Maps.CallbackOnLoad] is not a function

When used in PBI custom visual got errors:

Uncaught TypeError: Cannot read property 'prototype' of null
Uncaught TypeError: window[Microsoft.Maps.CallbackOnLoad] is not a function

Uncaught SyntaxError: Unexpected identifier
at Object.r [as injectJsCode] (VM11718 visualhostcore.min.js:2)
at i.loadWithoutResourcePackage (VM11719 visualsandbox.min.js:1)
at i.executeMessage (VM11719 visualsandbox.min.js:1)
at i.onMessageReceived (VM11719 visualsandbox.min.js:1)
at VM11719 visualsandbox.min.js:1
at e.invokeHandler (VM11718 visualhostcore.min.js:2)
at e.dispatchMessage (VM11718 visualhostcore.min.js:2)
at e.onMessageReceived (VM11718 visualhostcore.min.js:2)
at windowMessageHandler (VM11718 visualhostcore.min.js:2)
at dispatch (VM11714 visualsandbox.minimal.externals.js:16777)

Any ideas how to get Bing maps work oin PowerBI custom visual?
Working example would be appreciated ;)

Typings issue with geocoding request callback

Hi,

I have a problem with typings when I use the geocoding callback types.

    var mapControl = new Microsoft.Maps.Map(document.getElementById('bingMapContainer'), {
        credentials: 'some_key'
    });

    Microsoft.Maps.loadModule('Microsoft.Maps.Search', () => {
        var searchManager = new Microsoft.Maps.Search.SearchManager(mapControl);
        searchManager.geocode({
            bounds: mapControl.getBounds(),
            where: 'somewhere',
            callback: (answer, userData) => {
                mapControl.setView({ bounds: answer.results[0].bestView });
                mapControl.entities.push(new Microsoft.Maps.Pushpin(answer.results[0].location));
            }
        });
    });`

The IPlaceResult interface doesn't match what the Pushpin constructor is waiting for.
I have to replace the above code by this one to handle this.

mapControl.entities.push(new Microsoft.Maps.Pushpin(answer.results[0].location as any));

Kind regards and keep up the good work though !

Missing "square" NavigationBarMode

Hi,
I'd like to use "square" navigation bar mode, that is described in bingmaps docs, unfortunatelly here in defined enumeration it is not avaialble.
Could you please add it there, or explain why it should not be avaialble?

Directions waypointDisambiguation Unused / Documentation Incorrect

It appears there's a problem with the initial directions documentation. waypointDisambiguation and autoDisplayDisambiguation are referenced, but never actually used in Bing Maps V8.

Initial checkin:
b767afd#commitcomment-21954379

New file location:
https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions/blob/master/scripts/MicrosoftMaps/Modules/Directions.d.ts#L129

The migration documentation says disambiguation functionality was removed due to being rarely used (and no longer needed? Although that's confusing because that seems to indicate it's been replaced.)
https://social.technet.microsoft.com/wiki/contents/articles/34563.bing-maps-v7-to-v8-migration-guide.aspx

Bing Maps not Displaying

I am trying to create a bing map in an angular 4 web application, but the map will not display. My code previously displayed a map with this code.

setTimeout(()=> {
      var map = new Microsoft.Maps.Map('MyMap', {
        credentials: 'code',
        center: center,
        zoom: 11
      });
}, 200)

This issue has been occurring since 10/2.

I have an uncaught ReferenceError: DeprecatedClass is not defined, a ReferenceError: TravelAttractionEntity is not defined, and a ERROR ReferenceError: BirdseyeV2InfoExitControl is not defined.

I have also read that Bing Mpas AJAX Control v7 has reached end-of-life on 10/2 which is when I began experiencing this issue.

definitions?

I've installed the nuget package but no definitions were added in my asp.net core mvc project.

How can we get this working?

if I do Install-Package Microsoft.BingMaps.V8.TypeScript and then in app.ts

/// <reference path="types/MicrosoftMaps/Microsoft.Maps.All.d.ts" /> cannot find it. even no types directory has been created.

When tryping import 'bingmaps'; new Microso nothing from Microsoft or maps is found.

Uncaught ReferenceError: BirdseyeV2InfoExitControl is not defined

Uncaught ReferenceError: BirdseyeV2InfoExitControl is not defined
at o._appendBirdseyeV2InfoExitControl (www.bing.com/rms/MapDelayPluginBundle/cj,nj/32eb50fc/55a5cff6.js?bu=rms+answers+MapsSDKRelease+AnonymousBegin*Navigation*MapDelay.en*MapDelayPluginStart*TransitLandmarkOverlay*SharingImage*Permalink*DefaultPrimitiveCriteria*IRoutePolylineOptions*IRoutePushpinOptions*ITransitPushpinOptions*RoutePolyline*RoutePushpin*ListDataSource*KeyProvider*BrowserKeyProvider*PointerProvider*BrowserPointerProvider*MapInteractionKeyboardState*MapInteraction*MapModeStateHistory*PrintContent*BrowserHistoryManager*HashBasedHistory*HistoryWrapper*NavigationControl*AerialBirdsEyeTransitionManager*NavigationBar*MePoi*NavigationButton*NavigationButtonTemplate*NavigationHelper*RotateControl*GeochainControl*GeochainOverlay*GeochainTemplate*GeochainSegment*GeochainManager*LocateMeControl*LocateMeErrorDialog*SelectorControl*MapInteractionBehavior*OverlayManager*NavigationBarOverlay*GlobalDataEventHandler*ImageFromCssHelper*DataHandlerKeys*IDirectionsTaskState*Waypoint*CollectionEnumerators*OverlayEntity*OverlayDataEntityAction*TaskTypes*TaskDataHandlerHelper*LocalSearchEntity*RecommendationEntity*Geocoder*ReverseGeocoder*GeolocationProvider*ManipulationDelta*Inertia*PointerTrail*ManipulationDeltaTrail*StreetsideAutoEntryBehavior*StreetsideAutoEntryBubblePickerOverlay*StreetsideBootstrapper*StreetsideModeBootstrapper*StreetsideMiniOverlay*StreetsideMiniBootstrapper*StreetsideDirectionsOverlay*StreetsideDirectionsBootstrapper*StreetsideLocalDetailsBootstrapper*StreetsideCoverageBehavior*StreetsideBubblePickerOverlay*StreetsideLoggerConstants*StreetsidePerfConstants*ZoomInButton*ZoomOutButton*MapTypeSwitcherButton*TrafficToggleButton*RadialMenu*MapTypeButton*MapTypeButtonTemplate*RoadButton*AerialButton*BirdseyeButton*StreetsideButton*OrdnanceSurveyButton*SeasonalButton*GrayscaleButton*CanvasDarkButton*CanvasLightButton*SymbolicNightButton*WinterButton*LabelToggleButton*BirdseyeV2ExitButton*LandmarksManager*LandmarksOverlay*CityPolygonManager*MapDelayPluginEnd*AnonymousEnd*ExternalPromise:1)

Events as constants

I was thinking if is a good idea adding events as constants under for example in namespace Microsoft.Maps.Events. Some graphical elements like the map it is quite natural to use DOM events. But for example with DirectionsModule?

I don't know if it makes sense to add something like:

export class Microsoft.Maps.Events.DirectionsEvent{
 public static readonly DIRECTIONS_UPDATE = 'directionsUpdated';
 public static readonly DIRECTIONS_ERROR = 'directionsError';
}

Allthough it is not part of Bing Maps, it supports the developer. Is it a good idea adding event names as constants?

Capital letters in Microsoft.Maps.All.d.ts

Filename: Microsoft.Maps.All.d.ts

/// <reference path="Modules/GeoJson.d.ts"/>   on line 35 is without capital letters

file name is : "GeoJSON.d.ts"

Fix:

/// <reference path="Modules/GeoJSON.d.ts"/>

Cannot import types into project

Am working on Typescript project and having trouble importing the bingmap types. I try to import the types like so:

import { Location } from 'bingmaps'
import * as all from 'bingmaps'
import { Microsoft } from 'bingmaps'

I didn't try to import them all at the same time. These are just three ways I tried to import. In anycase I don't think the way I try to import them is the problem.

My compiler keeps complaining node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.all.d.ts is not a module.

Looking into node_modules/bingmaps folder, there are files.

I have the script and my map is working as expected. There must be some way to import the type definitions in my project... this surely should be documented somewhere. Can someone help?

How would you select language?

Hi,

I was wondering how you would configure the language when you initialize the map. I'm wondering if this is supported or if there is plans to support it.

https://stackoverflow.com/questions/39343024/set-map-language-with-bing-maps-javascript-v8-api

var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
/* No need to set credentials if already passed in URL */
center: new Microsoft.Maps.Location(51.50632, -0.12714),
mapTypeId: Microsoft.Maps.MapTypeId.aerial,
zoom: 10 });

Thanks,
Derek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.