this in CustomOverlay prototype methods
Spown opened this issue · 7 comments
I'll try experimenting, but not sure if I'll be able to get the definitions to work in that way.
Much obliged! I also have started a question on Stack Overflow regarding a workaround, but maybe it can yield some useful insights into the problem anyway.
Here is the HtmlPushpinLayer Typescript file for reference: https://github.com/Microsoft/BingMapsV8CodeSamples/blob/master/Samples/Custom%20Overlays/HtmlPushpinLayer/HtmlPushpinLayerModule.ts
Looks like you might be using the typescript definitions in JavaScript. If that is the case, this is likely a limitation of JavaScript intellisense in Visual Studio. Note that TypeScript definition support for JavaScript is relatively new in Visual Studio.
Well, I'm using VSCode, not VS and it used d.ts all along. But yeah, as I suspected, when consuming it with pure js in the way it is shown in the docs it wouldn't produce Intellisense for this
. I probably can rewrite my module in ts (not that I'm any good at it) and then transpile it back to js, but at this point I'm better off just reading docs. Intellisense isn't worth that much pain.
Thank you anyway.
Just a tip, the code samples in MSDN are fairly static, which the code samples here: http://bingmapsv8samples.azurewebsites.net/ are constant evolving and being improved.
Oh, thanks, this should be helpful!