Use es6 extends on bing classes ? RRS feed

  • Question

  • Hi,

    I'm trying to extend the Microsoft.Maps.PushPin classes from the BingMap API 7.0 using the javascript es6 'extends' method.

    class Marker extends Microsoft.Maps.PushPin {
        constructor(location, options) {
    	super(location, options);	// where location is an instance of Microsoft.Maps.Location	

    but it doesn't work, the object resulting of the command : new Marker(....) has the correct prototype but not the _location property. So I get an error when I try to add the marker on an EntityCollection.

    Uncaught TypeError: Cannot read property 'latitude' of undefined

    FYI, if I run the same code using new Microsoft.Maps.PushPin instead of new Marker, it work well.

    Is there a known issue with the extends method ?

    Thursday, July 23, 2015 4:00 PM


  • Looking around the web it sounds like there is an issue with the extends method in ES6. Probably best to ask for help in an ES6 forum for this issue.

    Friday, July 24, 2015 4:03 PM