Myths on Maps

  • Log in
  • « Response to Chelsea's Book 3 edit recs-
  • Hours »

Serving OL maps through eXist

Posted by gregster on 25 Feb 2013 in Activity log, Documentation

After a bit of experimentation I've discovered that serializing documents that include OpenLayers maps need to be served as text/html. I was serializing may pages as application/xhtml+xml and I got javascript errors like:

Uncaught TypeError: Object #<Document> has no method 'write' 

So, for OL pages, use this serialization option:

declare option exist:serialize "method=html5 media-type=text/html encoding=utf-8 indent=yes";

The obvious problem with serving as text/html is that, according to the spec:

The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML except when the XHTML is conforms to the guidelines in Appendix A. In particular, 'text/html' is NOT suitable for XHTML Family document types that add elements and attributes from foreign namespaces, such as XHTML+MathML [XHTML+MathML].

According to the spec, then, if one wants to use something like SVG directly in the document, you may not be able to on pages like this. Using SVG graphics in CSS seems to be OK, though.
I'm not yet sure what impact this will have on OL maps that include SVG via JS.

This entry was posted by Greg and filed under Activity log, Documentation.

Myths on Maps

This project will focus on deploying an interactive map of Europe with overlays for Greek and Roman myths, history, people and events.
SVN instructions for MoM editors
Development URL
HCMC Blogs home
  • Archives
  • Categories

Search

XML Feeds

  • Atom: Posts
  • RSS 2.0: Posts
What is RSS?

This collection ©2025 by admin • Help • Multiblog engine