Replace all instances and usages of LatLon to LonLat
git-svn-id: http://svn.openlayers.org/trunk/openlayers@99 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<ul id="testlist">
|
||||
<li>test_LatLon.html</li>
|
||||
<li>test_LonLat.html</li>
|
||||
<li>test_Pixel.html</li>
|
||||
<li>test_Icon.html</li>
|
||||
<li>test_Marker.html</li>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var latlon;
|
||||
function test_01_LatLon_constructor (t) {
|
||||
t.plan( 3 );
|
||||
latlon = new OpenLayers.LatLon(5,6);
|
||||
t.ok( latlon instanceof OpenLayers.LatLon, "new OpenLayers.LatLon returns LatLon object" );
|
||||
t.eq( latlon.lat, 5, "latlon.lat is set correctly");
|
||||
t.eq( latlon.lon, 6, "latlon.lon is set correctly");
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
18
tests/test_LonLat.html
Normal file
18
tests/test_LonLat.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var lonlat;
|
||||
function test_01_LonLat_constructor (t) {
|
||||
t.plan( 3 );
|
||||
lonlat = new OpenLayers.LonLat(6, 5);
|
||||
t.ok( lonlat instanceof OpenLayers.LonLat, "new OpenLayers.LonLat returns LonLat object" );
|
||||
t.eq( lonlat.lat, 5, "lonlat.lat is set correctly");
|
||||
t.eq( lonlat.lon, 6, "lonlat.lon is set correctly");
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@@ -23,8 +23,8 @@
|
||||
function test_02_Map_center(t) {
|
||||
t.plan(5);
|
||||
map = new OpenLayers.Map($('map'));
|
||||
map.setCenter(new OpenLayers.LatLon(1,2), 0);
|
||||
t.ok( map.getCenter() instanceof OpenLayers.LatLon, "map.getCenter returns a LatLon");
|
||||
map.setCenter(new OpenLayers.LonLat(2,1), 0);
|
||||
t.ok( map.getCenter() instanceof OpenLayers.LonLat, "map.getCenter returns a LonLat");
|
||||
t.eq( map.getZoom(), 0, "map.zoom is correct after calling setCenter");
|
||||
t.eq( map.getResolution(), map.maxResolution, "map.getResolution() == map.maxResolution");
|
||||
t.eq( map.getCenter().lat, 1, "map center lat is correct after calling setCenter");
|
||||
@@ -56,7 +56,7 @@
|
||||
function test_05_Map_center(t) {
|
||||
t.plan(4);
|
||||
map = new OpenLayers.Map($('map'));
|
||||
map.setCenter(new OpenLayers.LatLon(1,2), 0);
|
||||
map.setCenter(new OpenLayers.LonLat(2, 1), 0);
|
||||
map.zoomIn();
|
||||
t.eq( map.getZoom(), 1, "map.zoom is correct after calling setCenter,zoom in");
|
||||
t.eq( map.getCenter().lat, 1, "map center lat is correct after calling setCenter,zoom in");
|
||||
@@ -71,7 +71,7 @@
|
||||
this.count++;
|
||||
t.ok(true, "zoomend event was triggered " + this.count + " times");
|
||||
});
|
||||
map.setCenter(new OpenLayers.LatLon(1,2), 0);
|
||||
map.setCenter(new OpenLayers.LonLat(2, 1), 0);
|
||||
map.zoomIn();
|
||||
map.zoomOut();
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
function test_01_Marker_constructor (t) {
|
||||
t.plan( 5 );
|
||||
marker = new OpenLayers.Marker(new OpenLayers.Icon(),new OpenLayers.LatLon(1,2));
|
||||
marker = new OpenLayers.Marker(new OpenLayers.Icon(),new OpenLayers.LonLat(2,1));
|
||||
t.ok( marker instanceof OpenLayers.Marker, "new OpenLayers.Marker returns Marker object" );
|
||||
t.ok( marker.icon instanceof OpenLayers.Icon, "new marker.Icon returns Icon object" );
|
||||
t.ok( marker.latlon instanceof OpenLayers.LatLon, "new marker.latlon returns LatLon object" );
|
||||
t.eq( marker.latlon.lat, 1, "marker.latlon.lat returns correct lat" );
|
||||
t.eq( marker.latlon.lon, 2, "marker.latlon.lon returns correct lon" );
|
||||
t.ok( marker.lonlat instanceof OpenLayers.LonLat, "new marker.lonlat returns LonLat object" );
|
||||
t.eq( marker.lonlat.lat, 1, "marker.lonlat.lat returns correct lat" );
|
||||
t.eq( marker.lonlat.lon, 2, "marker.lonlat.lon returns correct lon" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user