none
v8 Ajax control sometimes works...sometimes not.. in Excel AddIn RRS feed

  • Question

  • I'm attempting to create an excel addin using the Bing Maps v8 Ajax control. I have two issues (may or may not be related) that I'm struggling with.

    1. The display of the control sometimes doesn't fill the content pane, but sometimes it does. I can't reproduce this behavior with just css/html content.

    2. I'm creating the map control with inline script in the html page and then attempting to populate pushpins from a js function and most of the time when I call Microsoft.Maps.loadModule('Microsoft.Maps.Search'...) I get an error that loadModule isn't available. It appears that Microsoft.Maps isn't available sometimes from my js code..   thoughts on the best way to tshoot?

    Thanks

    Brian

    Tuesday, November 8, 2016 3:50 PM

Answers

  • 1) If you are using percentage width/height values for the map div, try using pixel dimensions to see if that makes a difference. If it does, the likely issue is that the map div isn't able to determine the dimension of it's parent and thus isn't able to fill 100%. If this is the issue, try wrapping the map div with another div and set it's width/height to 100vw and 100vh accordingly or try 100% to see if that helps.

    2) By the sounds of it the map script hasn't been loaded, or isn't available yet. Make sure that your code has loaded the map script and that it has had time to load. When it loads it also requests several additional resources. You can pass in a callback function into the map script URL, which will be called after the map API has had a chance to load. For example: http://www.bing.com/api/maps/mapcontrol?callback=GetMap


    [Blog] [twitter] [LinkedIn]

    Wednesday, November 9, 2016 8:03 PM