Opened 7 years ago

Closed 7 years ago

#2411 closed bug (duplicate)

Set to false but keeps loading default theme

Reported by: knox Owned by:
Priority: minor Milestone: 2.10 Release
Component: Map Version: 2.8
Keywords: theme Cc:


I've set the theme property to false in the constructor but it keeps trying to load the default theme (the webserver log is full of HTTP 404 for theme/default/style.css)

Here is my original invocation (it's generated automaticly and thus might seem a bit balky)

<script type="text/javascript" defer="defer">
var map;
map = new OpenLayers.Map('map', {units : "km",controls : [],theme : false,projection : new OpenLayers.Projection("EPSG:900913"),displayProjection : new OpenLayers.Projection("EPSG:4326")});
map.addControl(new OpenLayers.Control.Navigation());
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Attribution());
map.addControl(new OpenLayers.Control.Permalink("permalink"));
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.OverviewMap({layers : [new OpenLayers.Layer.OSM("OpenStreetMap")]}));
map.addLayer(new OpenLayers.Layer.OSM("OpenStreetMap"));
map.addLayer(new OpenLayers.Layer.GeoRSS("Nodes","/nodes/georss",{projection : new OpenLayers.Projection("EPSG:4326")}));
map.setCenter(new OpenLayers.LonLat(9.738435,52.374394).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject()),13); 

You can find it running live on

I am using Firefox 3.5.6

Change History (5)

comment:1 Changed 7 years ago by knox

  • Cc mickey@… removed

comment:3 in reply to: ↑ 2 Changed 7 years ago by knox

Replying to fredj:

try to set the theme to null instead of false.

According to the source it shouldn't make any difference:

 // only append link stylesheet if the theme property is set
 	        if(this.theme) {

Also OpenLayers.Util.extend shouldn't worry about it.

Nevertheless i will try your suggestion as soon as i get back to my workstation.

comment:4 Changed 7 years ago by bartvde

See also ticket:2619 (to me this feels as a duplicate).

comment:5 Changed 7 years ago by fredj

  • Resolution set to duplicate
  • Status changed from new to closed

knox: in your example the 404 comes from the OverviewMap, not the Map. Try to create the control with:

map.addControl(new OpenLayers.Control.OverviewMap({
    layers : [new OpenLayers.Layer.OSM("OpenStreetMap")],
    theme: null

I close this ticket as duplicate because since r10372 the theme option is deprecated.

Note: See TracTickets for help on using tickets.