[OpenLayers-Users] Beware: DOCTYPE declaration when trying out Examples

jlpoole jlpoole56 at gmail.com
Tue Feb 7 11:09:38 EST 2012


When you are trying out the examples at
docs.openlayers.org/library/introduction.html or at
http://openlayers.org/dev/examples/, beware that having a DOCTYPE
declaration such as:

<! &lt;b>DOCTYPE *html PUBLIC "-//W3C//DTD* XHTML 1.0* Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

may cause the map not to appear.  I started trying out some examples and
popped the HTML code into a new page in Adobe Dreamweaver and deployed the
pages to my testing server and nothing was displaying.  I spent some time
trying to debug working backwards to the simplest of examples: "Ex. 1:
Creating your first HTML Page" at the Introduction page and still not have a
map displayed.  I was about to submit a posting to this forum asking why the
most basic examples were not displaying a map and then realized what I was
doing differently was using the default DOCTYPE declaration that Dreamweaver
was automatically placing in my new files.  When I removed the DOCTYPE
declaration, in this case XHTML 1.0, from the page, thereby starting the
page with "<html>...", the map would display.

I think the Introduction ought to have a caveat that a DOCTYPE declaration
may break the rendering ability of the page.  Moreover, perhaps it would be
beneficial to include a DOCTYPE declaration in the examples that complies
thereby being more specific.  I just assumed the XHMTL 1.0 specifications
would be able to handle these OpenLayers examples; I was wrong.



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Beware-DOCTYPE-declaration-when-trying-out-Examples-tp4373016p4373016.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list