Blog Post: Simple Custom Infoboxes in BMv7 RRS feed

  • General discussion

  • With the last release of Bing Maps it became apparent that a lot of people where hacking the Bing Maps CSS for the infobox rather than using a supported method for adding custom content to the infobox. I have written a blog post that demonstarts a supported method for creating an infobox that looks similar to the built in infobox but supports custom HTML. You can find the blog post here:
    • Moved by Ricky_Brundritt Saturday, March 10, 2012 11:51 AM (From:Bing Maps: Map Control and Web services Development)
    Tuesday, November 8, 2011 7:48 PM

All replies

  • To be fair to those of us who have had to "hack" bing maps (ps it isn't just css that needed fixin), your example only begins to work in version 7.0.20111102162939.34 of the maps api that was released last week.

    Prior to that, Infobox positioning of custom htmlContent was done "top left" (as opposed to the "bottom left" positioning introduced in 7.0.20111102162939.34), so your Infobox would have looked like:


    Tuesday, November 8, 2011 10:15 PM
  • To be fairer the original code I pulled a lot of this from was created months ago for a client and the infobox still works properly. The positioning issue you are refering to is a new bug which is specific to certain browsers and the above code does not attempt to fix that bug it only attempts to show how custom infoboxes can be created without hacking the control. The positioning issue is a completely seperate issue that has nothing to do with what I am trying to show in article.
    Wednesday, November 9, 2011 10:34 AM
  • We're confusing two issues. Yes there is a positioning bug in IE (< 9), but that is not what I'm referring to and not what the positioning error in the screenshot shows. What I'm referring to is the change in 7.0.20111102162939.34 by the bing team to draw custom infoboxes anchored at the rectangle's bottom left rather than it's top left. I'm sure someone from the dev team can verify that this change did occur if you don't know what I'm talking about.

    Go ahead and try your page in an earlier version such as 7.0.2011100111334.47 or earlier (not IE < 9 though!). I have - that's how I got the screen shot - and it would take more work (read "hacks") to position the Infobox above the pin (involving reading off width/height). At least in a non-trivial, DRY manner.

    Wednesday, November 9, 2011 2:20 PM
  • The code I wrote before still works. But in anycase, the point is that creating a custom infobox in a supported manner is not that hard. The bonus of using supported method is that if it breaks then the dev team will more likely ensure a fix is created, where as hacks usually are not fixed.
    Wednesday, November 9, 2011 4:29 PM