none
Debug version of veapicore.js for Bing API V7 RRS feed

  • Question

  • Is there a debug version of veapicore.js available for Bing API V7?

    I'm getting an error when rendering a map in Win7/IE11 (works in Windows IE 10, Mac OSX Chrome v49, Win7 Chrome v49, Mac Safari v9.0.3)

    It is blowing up in this function (minified, which is why I want to get a debug version so I can trace through and understand the _why_):

     function fi() {r && i && (r.mercatorZoom > i.mercatorZoom ? (i.getRootElement().nextSibling == null ? w.appendChild(r.getRootElement()) : w.insertBefore(r.getRootElement(), i.getRootElement().nextSibling), r.opacity = 0) :
    (w.insertBefore(r.getRootElement(), i.getRootElement()), r.opacity = 1)); }


    specifically the final line: w.insertBefore(r.getRootElement(), i.getRootElement())

    w, r and i are all HTML div elements.   None of them belong to the current DOM document (checked via document.documentElement.contains(w), document.documentElement.contains(r), document.documentElement.contains(i) all being false)

    The insertBefore is failing with a NotFoundError, which seems like it can't find the 'r' element in the current DOM to insert the 'i' element info.

    Thanks in advance for your help,
    Jeff

    Friday, April 15, 2016 6:31 PM

Answers

  • There isn't a debug version of the map control (that would require making the code easily readable and would need to be made open source).

    However, the issue isn't in the V7 API, but in how you are using it. Add a break point to your code and step through and find at which line the code breaks. This will likely point to where the issue is. If you have issues, provide a code block that reproduces the issue, or at least the line of code that causes the error.

    Is the app online? If so, provide a link an I'll take a look.

    Are you loading the map control dynamically or using a script tag? Is the map script loaded before you start trying to access it?

    It's also possible that the error is occurring in code that has nothing to do with the map. The map tends to catch a lot of errors that are thrown from other places from what I have seen in the past. Stepping through the code and finding what line of your code firsts last before this error occurs. 


    [Blog] [twitter] [LinkedIn]

    Friday, April 15, 2016 7:50 PM
  • There are no plans to expose a debuggable version of the Bing Maps source code publicly as it would make it extremely easy to scrape the code and use it elsewhere (i.e. competing map platforms).

    If the error is happening when you go back to the page, try putting the breakpoint right were the map is loaded. I suspect that this issue is due to things being loaded before they are ready to be used.


    [Blog] [twitter] [LinkedIn]

    Saturday, April 16, 2016 2:35 AM

All replies

  • There isn't a debug version of the map control (that would require making the code easily readable and would need to be made open source).

    However, the issue isn't in the V7 API, but in how you are using it. Add a break point to your code and step through and find at which line the code breaks. This will likely point to where the issue is. If you have issues, provide a code block that reproduces the issue, or at least the line of code that causes the error.

    Is the app online? If so, provide a link an I'll take a look.

    Are you loading the map control dynamically or using a script tag? Is the map script loaded before you start trying to access it?

    It's also possible that the error is occurring in code that has nothing to do with the map. The map tends to catch a lot of errors that are thrown from other places from what I have seen in the past. Stepping through the code and finding what line of your code firsts last before this error occurs. 


    [Blog] [twitter] [LinkedIn]

    Friday, April 15, 2016 7:50 PM
  • Thanks For the reply Ricky.

    Bummer; wish there was a debug version like other javascript libraries have.  Is there plans for one in the future?

    I'll see if I can find a reasonable code block to post.  The app is not online (yet) so I unfortunately cannot share the site. 

    The map control is being loaded dynamically.  We have a combination of Backbone.js, Marionette running this.

    The basic flow is:
    - Show the Map
    - Enter a zipcode
    - Map shows stores for that zipcode in the map with pins
    - View shows a list of stores in the HTML view
    - User clicks a store in the HTML view
    - Next page of the wizard is rendered 
    - User clicks the back button in the wizard
    - App takes user back to the first page.  

    Someplace in that re-rendering is causing the issue.  I'll attempt to identify the exact line as you recommended.

    I did find and attempted the fixes shown in these posts, but that did not affect this issue.

    // https://social.msdn.microsoft.com/Forums/en-US/abde3d6f-f0ee-467a-b2ef-132836d73c5f/polygon-mouse-events-are-not-working-on-ie11-but-working-fine-any-other-browers-and-ie-10-even?forum=bingmapsajax

    map.getMode().setOptions({ drawShapesInSingleLayer : true });

    {!https://social.msdn.microsoft.com/Forums/en-US/abde3d6f-f0ee-467a-b2ef-132836d73c5f/polygon-mouse-events-are-not-working-on-ie11-but-working-fine-any-other-browers-and-ie-10-even?forum=bingmapsajax!}

    <style>

        .MicrosoftMapDrawing, .MapPushpinBase{

            pointer-events: auto !important;

        }

    </style>

     

    Thanks,

    Jeff

    Friday, April 15, 2016 8:01 PM
  • There are no plans to expose a debuggable version of the Bing Maps source code publicly as it would make it extremely easy to scrape the code and use it elsewhere (i.e. competing map platforms).

    If the error is happening when you go back to the page, try putting the breakpoint right were the map is loaded. I suspect that this issue is due to things being loaded before they are ready to be used.


    [Blog] [twitter] [LinkedIn]

    Saturday, April 16, 2016 2:35 AM