3
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
4
<script src="../../lib/OpenLayers.js"></script>
5
<script type="text/javascript">
8
function test_Layer_Yahoo_constructor (t) {
11
var tempEventPane = OpenLayers.Layer.EventPane.prototype.initialize;
12
OpenLayers.Layer.EventPane.prototype.initialize = function(name, options) {
13
t.ok(name == g_Name, "EventPane initialize() called with correct name");
14
t.ok(options == g_Options, "EventPane initialize() called with correct options");
17
var tempFixedZoomLevels = OpenLayers.Layer.FixedZoomLevels.prototype.initialize;
18
OpenLayers.Layer.FixedZoomLevels.prototype.initialize = function(name, options) {
19
t.ok(name == g_Name, "FixedZoomLevels initialize() called with correct name");
20
t.ok(options == g_Options, "FixedZoomLevels initialize() called with correct options");
26
var l = new OpenLayers.Layer.Yahoo(g_Name, g_Options);
28
OpenLayers.Layer.EventPane.prototype.initialize = tempEventPane;
29
OpenLayers.Layer.FixedZoomLevels.prototype.initialize = tempFixedZoomLevels;
32
function test_Layer_Yahoo_loadMapObject(t) {
36
YMap = OpenLayers.Class({
37
initialize: function(div, type, size) {
38
t.ok(div == g_Div, "correct div passed to YMap constructor");
39
t.ok(type == g_Type, "correct type passed to YMap constructor");
40
t.ok(size == g_YMapSize, "correct size passed to YMap constructor");
42
disableKeyControls: function() {
43
t.ok(true, "disableKeyControls called on map object");
52
var l = new OpenLayers.Layer.Yahoo();
56
'getSize': function() {
60
l.getMapObjectSizeFromOLSize = function(mapSize) {
61
t.ok(mapSize == g_MapSize, "correctly translating map size from ol to YSize");
70
function test_Layer_Yahoo_onMapResize(t) {
76
var l = new OpenLayers.Layer.Yahoo();
78
'resizeTo': function(size) {
79
t.ok(size == g_YMapSize, "correct YSize passed to reiszeTo on map object");
83
'getSize': function() {
87
l.getMapObjectSizeFromOLSize = function(mapSize) {
88
t.ok(mapSize == g_MapSize, "correctly translating map size from ol to YSize");
95
function test_Layer_Yahoo_getMapObjectSizeFromOLSize(t) {
99
YSize = function(w, h) {
100
t.ok(w == g_Size.w, "correct width passed to YSize constructor");
101
t.ok(h == g_Size.h, "correct height passed to YSize constructor");
109
OpenLayers.Layer.Yahoo.prototype.getMapObjectSizeFromOLSize(g_Size);