[OpenLayers-Trac] [OpenLayers] #460: full CSS support
OpenLayers
trac at openlayers.org
Wed Mar 21 18:52:05 EDT 2007
#460: full CSS support
----------------------+-----------------------------------------------------
Reporter: tschaub | Owner:
Type: feature | Status: new
Priority: minor | Milestone: 2.5 Release
Component: general | Version:
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by tschaub):
This can make it in to 2.4 with a pretty simple patch. With the following
patch, if you want better css support, you do three things:
1) include the default stylesheet above your script tag
{{{
<link rel="stylesheet" href="../theme/default/style.css"
type="text/css" />
}}}
2) include any non-default style declarations below the default stylesheet
{{{
<style type="text/css">
div.olControlMousePosition {
color: red;
}
</style>
}}}
3) construct your map with options that include {theme: null}
{{{
var options = {theme: null};
var map = new OpenLayers.Map('map', options);
}}}
If a map's theme property is null (or false), the default stylesheet will
not be appended to the dom via the old method. This allows application
designers to modify the default style without editing default/style.css.
This doesn't get around the issues created by appending link elements to
the head programmatically. Namely, an application designer can no longer
roll through document.styleSheets without the browser giving them trouble.
However, unless this is a problem for anybody else at this point, I think
this should go in 2.4.
--
Ticket URL: <http://trac.openlayers.org/ticket/460#comment:2>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list