Ticket #2411 (closed bug: duplicate)

Opened 5 years ago

Last modified 4 years ago

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:
State:

Description

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); 
</script>

You can find it running live on  http://db.hannover.freifunk.net/map

I am using Firefox 3.5.6

Change History

  Changed 5 years ago by knox

  • cc mickey@… removed

follow-up: ↓ 3   Changed 5 years ago by fredj

in reply to: ↑ 2   Changed 5 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.

  Changed 4 years ago by bartvde

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

  Changed 4 years ago by fredj

  • status changed from new to closed
  • resolution set to duplicate

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.