Using the Virtual Earth v2 control in Firefox

Posted by admin, Fri Feb 24 10:27:13 UTC 2006

So, you’ve started using the Virtual Earth v2 control, and discovered… it doesn’t quite work right in Firefox, does it? Of course, this blog from last week notes that you need a “wedge” in order to make it work right… but it’s not official.

Virtual Earth

As many of you have pointed out to me, the v2 control does not support firefox as well as the Windows Live Local site does. There is actually a wedge you can put in place to fix most of these issues, but it is not officially part of the SDK today.


I find it vaguely amusing that I did a “view page source” on local.live.com the same week it was released (back in DECEMBER), and found the “wedge”, and have been using it ever since… I guess three months isn’t too far behind… (sigh).

But you know what? Firefox still didn’t work right for my map. I was following this example:

Via Virtual Earth
Creating Your First Virtual Earth v2 Page (Part 1)


And I discovered that it worked ok in IE, but in Firefox the map spread out all over the page, instead of staying inside its nicely size-limited div. This was a big problem for me. All of my page header graphics disappear under the map, and all my navigation links were practically invisible (on an aerial map).

But yesterday, I discovered this example.

Virtual Earth: Tutorial Part 1 – AJAX and Virtual Earth
Tutorial Part 1 – AJAX and Virtual Earth


And wouldn’t you know…? It looked just fine in Firefox. Grrr.

So I pulled out “view page source” again, and eventually discovered the difference. I say eventually because I couldn’t believe it the first couple of tries (that can’t be it!). Anyway, if you have the uncontained Virtual Earth map problem in Firefox, all you need to do is add “position:relative” to the style attribute of the containing div, and you are good to go.

Too bad it still doesn’t work in Safari, though :-(

Filed Under: | Tags:

Comments

  1. Irfan 04.03.06 / 01AM
    Hi, I am facing problems removing pushpins in Firefox. My code works fine on IE but no good in Firefox. I have a simple list of locations in html table (a tags). The map starts with US view and show one pushpin for each location. As I hover over any of these locations it zooms on to it and show me a pushpin. As I hover out it defaults back to US view with all the pushpins. In Firefox, it zooms fine but doesn't remove previously added pushpins. Can you help me with this? Thanks, Irfan
  2. lori 04.03.06 / 02AM
    I'm afraid my application has not needed to remove pushpins yet. Have you looked at the examples on ViaVirtualEarth? http://viavirtualearth.com/vve/Resources/QuickStarts.ashx If that doesn't help, then poke around in their forums, and if you don't find your answer there, ask. They have been quite responsive. http://www.viavirtualearth.com/vve/Forum/1.ashx Regards, Lori
  3. Keith Hyland 04.18.06 / 09AM
    Cheers Great post.. Exactly what I was looking for.
  4. Geoff 04.26.06 / 05AM
    That's wonderful, the quickstart example on the link you provided does NOT work in firefox. Not surprising for a nutscrape clone. Oh why do you people insist on using this crap software? I spend more time debugging its problem than I do developing the original site.
  5. lori 05.09.06 / 03AM
    Sorry for not replying earlier, but I've been on a "no computer" vacation for the last 2 weeks. Anyway, if you are referring to the "AJAX query" part of that example, you are correct, it does not work. But the behaviour of the map *works* in Firefox, which was what I was after. And if you develop all your stuff to work in Firefox first, and then go back and work around the stupid IE bugs, you will find your job much simpler.

Have your say

A name is required. You may use HTML in your comments.