If you take a look at maps.live.com you’ll see the Mini Map is in the Top Right corner of the map. Virtual Earth doesn’t have any alignment options built in when showing the Mini Map. It just allows you to position the mini map using x and y offset coordinates relating to the top left corner of the map. This makes it really easy to show the mini map in relation to the top left corner, but what makes this tricky is the dashboard is already there.
Here’s small example I wrote up on how to align the Mini Map in the Top Right corner of the map. This code also hooks into the Maps onresize event so it can move the Mini Map to the desired location when ever the map is resized.
Here’s a screenshot of it in action:
Here’s the code:
This code works in IE, Firefox and Safari 3 on Windows. I haven’t tested any other browsers, but I assume it’ll work in others as well. Another thing to note is that this code will only work if there is only a single Virtual Earth map on the page; it’ll break with multiple maps on the same page.
Sorry, I didn’t have time to write up a nice article surrounding this code. But, I did add a bunch of comments to make it more readable.
This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participates in affiliate programs with Udemy, and other sites. This site is compensated for referring traffic and business to these companies.