Changeset 103
- Timestamp:
- 05/17/06 12:20:12 (3 years ago)
- Files:
-
- trunk/openlayers/google.html (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (3 diffs)
- trunk/openlayers/tests/test_Bounds.html (modified) (1 diff)
- trunk/openlayers/tests/test_LonLat.html (modified) (1 diff)
- trunk/openlayers/tests/test_Map.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Marker.html (modified) (1 diff)
- trunk/openlayers/tests/test_Tile.html (modified) (1 diff)
- trunk/openlayers/tests/test_Tile_Image.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/google.html
r99 r103 15 15 <script type="text/javascript"> 16 16 <!-- 17 var lon = 5; 17 18 var lat = 40; 18 var lon = 5;19 19 var zoom = 5; 20 20 var map, layer; trunk/openlayers/lib/OpenLayers/Map.js
r99 r103 223 223 */ 224 224 getLonLatFromPixel: function (point) { 225 var center = this.getCenter(); //map center l at/lon225 var center = this.getCenter(); //map center lon/lat 226 226 var res = this.getResolution(); 227 227 var size = this.getSize(); trunk/openlayers/lib/OpenLayers/Util.js
r101 r103 149 149 150 150 /** 151 * @class This class represents a l atitude and longitude pair151 * @class This class represents a longitude and latitude pair 152 152 */ 153 153 OpenLayers.LonLat = Class.create(); … … 161 161 */ 162 162 initialize: function(lon, lat) { 163 this.lon = lon; 163 164 this.lat = lat; 164 this.lon = lon;165 165 }, 166 166 … … 234 234 /** 235 235 * @class This class represents a bounding box. 236 * Data stored as Min and Max L atitudes and Longitudes236 * Data stored as Min and Max Longitudes and Latitudes 237 237 */ 238 238 OpenLayers.Bounds = Class.create(); trunk/openlayers/tests/test_Bounds.html
r32 r103 8 8 bounds = new OpenLayers.Bounds(1,2,3,4); 9 9 t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" ); 10 t.eq( bounds.minlon, 2, "bounds.minlon is set correctly" ); 10 11 t.eq( bounds.minlat, 1, "bounds.minlat is set correctly" ); 11 t.eq( bounds.m inlon, 2, "bounds.minlon is set correctly" );12 t.eq( bounds.maxlon, 4, "bounds.maxlon is set correctly" ); 12 13 t.eq( bounds.maxlat, 3, "bounds.maxlat is set correctly" ); 13 t.eq( bounds.maxlon, 4, "bounds.maxlon is set correctly" );14 14 15 15 } trunk/openlayers/tests/test_LonLat.html
r99 r103 8 8 lonlat = new OpenLayers.LonLat(6, 5); 9 9 t.ok( lonlat instanceof OpenLayers.LonLat, "new OpenLayers.LonLat returns LonLat object" ); 10 t.eq( lonlat.lon, 6, "lonlat.lon is set correctly"); 10 11 t.eq( lonlat.lat, 5, "lonlat.lat is set correctly"); 11 t.eq( lonlat.lon, 6, "lonlat.lon is set correctly");12 12 } 13 13 // --> trunk/openlayers/tests/test_Map.html
r99 r103 28 28 t.eq( map.getZoom(), 0, "map.zoom is correct after calling setCenter"); 29 29 t.eq( map.getResolution(), map.maxResolution, "map.getResolution() == map.maxResolution"); 30 t.eq( map.getCenter().lon, 2, "map center lon is correct after calling setCenter"); 30 31 t.eq( map.getCenter().lat, 1, "map center lat is correct after calling setCenter"); 31 t.eq( map.getCenter().lon, 2, "map center lon is correct after calling setCenter");32 32 } 33 33 function test_03_Map_add_layers(t) { … … 60 60 map.zoomIn(); 61 61 t.eq( map.getZoom(), 1, "map.zoom is correct after calling setCenter,zoom in"); 62 t.eq( map.getCenter().lon, 2, "map center lon is correct after calling setCenter, zoom in"); 62 63 t.eq( map.getCenter().lat, 1, "map center lat is correct after calling setCenter,zoom in"); 63 t.eq( map.getCenter().lon, 2, "map center lon is correct after calling setCenter, zoom in");64 64 map.zoomOut(); 65 65 t.eq( map.getZoom(), 0, "map.zoom is correct after calling setCenter,zoom in, zoom out"); trunk/openlayers/tests/test_Marker.html
r99 r103 11 11 t.ok( marker.icon instanceof OpenLayers.Icon, "new marker.Icon returns Icon object" ); 12 12 t.ok( marker.lonlat instanceof OpenLayers.LonLat, "new marker.lonlat returns LonLat object" ); 13 t.eq( marker.lonlat.lon, 2, "marker.lonlat.lon returns correct lon" ); 13 14 t.eq( marker.lonlat.lat, 1, "marker.lonlat.lat returns correct lat" ); 14 t.eq( marker.lonlat.lon, 2, "marker.lonlat.lon returns correct lon" );15 15 } 16 16 trunk/openlayers/tests/test_Tile.html
r88 r103 12 12 t.ok( tile instanceof OpenLayers.Tile, "new OpenLayers.Tile returns Tile object" ); 13 13 t.ok( tile.bounds instanceof OpenLayers.Bounds, "tile.bounds is a Bounds object" ); 14 t.eq( tile.bounds.minlon, 2, "tile.bounds.minlon is set correctly"); 14 15 t.eq( tile.bounds.minlat, 1, "tile.bounds.minlat is set correctly"); 16 t.eq( tile.bounds.maxlon, 4, "tile.bounds.maxlon is set correctly"); 15 17 t.eq( tile.bounds.maxlat, 3, "tile.bounds.maxlat is set correctly"); 16 t.eq( tile.bounds.minlon, 2, "tile.bounds.minlon is set correctly");17 t.eq( tile.bounds.maxlon, 4, "tile.bounds.maxlon is set correctly");18 18 t.ok( tile.size instanceof OpenLayers.Size, "tile.size is a Size object" ); 19 19 t.eq( tile.size.w, 5, "tile.size.w is set correctly"); trunk/openlayers/tests/test_Tile_Image.html
r98 r103 12 12 t.ok( tile instanceof OpenLayers.Tile.Image, "new OpenLayers.Tile returns Tile object" ); 13 13 t.ok( tile.bounds instanceof OpenLayers.Bounds, "tile.bounds is a Bounds object" ); 14 t.eq( tile.bounds.minlon, 2, "tile.bounds.minlon is set correctly"); 14 15 t.eq( tile.bounds.minlat, 1, "tile.bounds.minlat is set correctly"); 16 t.eq( tile.bounds.maxlon, 4, "tile.bounds.maxlon is set correctly"); 15 17 t.eq( tile.bounds.maxlat, 3, "tile.bounds.maxlat is set correctly"); 16 t.eq( tile.bounds.minlon, 2, "tile.bounds.minlon is set correctly");17 t.eq( tile.bounds.maxlon, 4, "tile.bounds.maxlon is set correctly");18 18 t.ok( tile.size instanceof OpenLayers.Size, "tile.size is a Size object" ); 19 19 t.eq( tile.size.w, 5, "tile.size.w is set correctly");
