Well, much to my chagrin, one of the very helpful folks in the local developer community burst my bubble of pride over my accomplishments by pointing out that the map page I build failed miserably on Firefox.
One of the things I was playing with using the VE map control was a utility page that would take an address, and then map the location and return the latitude/longitude for the address. Not having written client-side code in a while, I innocently tried to write the result out to a div using element.innerText. Well, that worked great in IE, but it’s not supported in Firefox. So a few searches later, here’s what I found:
var lldiv = document.getElementById(‘latlong’);
var txt = ‘The Lat/Long is:’ + map.GetCenter(); lldiv.appendChild(document.createTextNode(txt));
So basically, I use document.getElementByID to get a reference to the div that I want to write to, then call appentChild on it to populate the text. I’ve tested this in IE7 and Firefox 2, but don’t have the resources to test it elsewhere at the moment. I’m hoping it will work across other browsers as well…if you’re interested in playing with the full code for the page, contact me and I’ll be happy to share it.
I’ll have more to come on this topic soon.