I’ve been playing around with the Google Maps API recently as I attempt to write an article on its usage. Right off the bat, I found a problem.

All of the pages on my site are served up as proper XHTML, including the XML prolog and serving the pages up as application/xhtml+xml in Firefox. Apparently, this causes the Google Maps API fits because it wants to use document.write(), which doesn’t exist in the XHTML DOM.

A quick search through the Google Maps API Group reveals no answer other than, “remove the XML declaration and don’t serve up your page as application/xhtml+xml.” What? You’ve got to be kidding me. This seems to be a major oversight of the Google Maps API team, to use a feature that is deprecated. All of the examples provided use the strict XHTML but we’re not actually supposed to have valid strict XHTML? I hope someone is looking into fixing this.

Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of my employer, my colleagues, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.

Both comments and pings are currently closed.