|
83 | 83 | function test_Map_setOptions(t) {
|
84 | 84 | t.plan(2);
|
85 | 85 | map = new OpenLayers.Map('map', {maxExtent: new OpenLayers.Bounds(100, 200, 300, 400)});
|
86 |
| - map.setOptions({theme: 'foo'}); |
| 86 | + map.setOptions({projection: 'EPSG:900913'}); |
87 | 87 |
|
88 |
| - t.eq(map.theme, 'foo', "theme is correctly set by setOptions"); |
| 88 | + t.eq(map.projection, 'EPSG:900913', "projection is correctly set by setOptions"); |
89 | 89 | t.ok(map.maxExtent.equals(new OpenLayers.Bounds(100, 200, 300, 400)),
|
90 | 90 | "maxExtent is correct after calling setOptions");
|
91 | 91 |
|
|
128 | 128 |
|
129 | 129 | function test_Map_options(t) {
|
130 | 130 | t.plan(3);
|
131 |
| - map = new OpenLayers.Map('map', {numZoomLevels: 6, maxResolution: 3.14159, theme: 'foo'}); |
| 131 | + map = new OpenLayers.Map('map', {numZoomLevels: 6, maxResolution: 3.14159, projection: 'EPSG:900913'}); |
132 | 132 | t.eq( map.numZoomLevels, 6, "map.numZoomLevels set correctly via options hashtable" );
|
133 | 133 | t.eq( map.maxResolution, 3.14159, "map.maxResolution set correctly via options hashtable" );
|
134 |
| - t.eq( map.theme, 'foo', "map theme set correctly." ); |
| 134 | + t.eq( map.projection, 'EPSG:900913', "map projection set correctly." ); |
135 | 135 |
|
136 | 136 | map.destroy();
|
137 | 137 | }
|
|
855 | 855 | map.destroy();
|
856 | 856 | }
|
857 | 857 |
|
858 |
| - function test_Map_defaultTheme(t) { |
859 |
| - t.plan(5); |
860 |
| - |
861 |
| - var links = document.getElementsByTagName('link'); |
862 |
| - map = new OpenLayers.Map('map'); |
863 |
| - var gotNodes = 0; |
864 |
| - var themeNode = null; |
865 |
| - for(var i=0; i<links.length; ++i) { |
866 |
| - if(OpenLayers.Util.isEquivalentUrl(map.theme, links.item(i).href)) { |
867 |
| - gotNodes += 1; |
868 |
| - themeNode = links.item(i); |
869 |
| - } |
870 |
| - } |
871 |
| - t.eq(gotNodes, 1, "by default, a single link node is added to document"); |
872 |
| - t.ok(themeNode != null, "a link node with the theme href was added"); |
873 |
| - t.eq(themeNode.rel, "stylesheet", "node added has rel set to stylesheet"); |
874 |
| - t.eq(themeNode.type, "text/css", "node added has type set to text/css"); |
875 |
| - |
876 |
| - // reconstruct the map to prove that another link is not added |
877 |
| - map = new OpenLayers.Map('map'); |
878 |
| - t.eq(links.length, document.getElementsByTagName('link').length, |
879 |
| - "calling the map constructor twice with the same theme doesn't add duplicate link nodes"); |
880 |
| - |
881 |
| - map.destroy(); |
882 |
| - } |
883 |
| - |
884 |
| - function test_Map_customTheme(t) { |
885 |
| - t.plan(5); |
886 |
| - |
887 |
| - var customTheme = 'foo'; |
888 |
| - var options = {theme: customTheme}; |
889 |
| - map = new OpenLayers.Map('map', options); |
890 |
| - |
891 |
| - var links = document.getElementsByTagName('link'); |
892 |
| - var gotNodes = 0; |
893 |
| - var themeNode = null; |
894 |
| - for(var i=0; i<links.length; ++i) { |
895 |
| - if(OpenLayers.Util.isEquivalentUrl(map.theme, links.item(i).href)) { |
896 |
| - gotNodes += 1; |
897 |
| - themeNode = links.item(i); |
898 |
| - } |
899 |
| - } |
900 |
| - |
901 |
| - t.eq(map.theme, customTheme, "map theme is properly set"); |
902 |
| - t.eq(gotNodes, 1, "with custom theme, a single link node is added to document"); |
903 |
| - t.ok(themeNode != null, "a link node with the theme href was added"); |
904 |
| - t.eq(themeNode.rel, "stylesheet", "node added has rel set to stylesheet"); |
905 |
| - t.eq(themeNode.type, "text/css", "node added has type set to text/css"); |
906 |
| - |
907 |
| - map.destroy(); |
908 |
| - } |
909 |
| - |
910 |
| - function test_Map_noTheme(t) { |
911 |
| - t.plan(1); |
912 |
| - |
913 |
| - var head = document.getElementsByTagName('head')[0]; |
914 |
| - var nodeCount = head.childNodes.length; |
915 |
| - |
916 |
| - var options = {theme: null}; |
917 |
| - map = new OpenLayers.Map('map', options); |
918 |
| - |
919 |
| - t.eq(nodeCount, head.childNodes.length, "with no theme, a node is not added to document head" ); |
920 |
| - |
921 |
| - map.destroy(); |
922 |
| - } |
923 |
| - |
924 | 858 | function test_Map_addControls(t) {
|
925 | 859 | t.plan(5);
|
926 | 860 | var map = new OpenLayers.Map('map', {
|
|
0 commit comments