[OpenLayers-Commits] r2330 - in sandbox/vector-2.4: lib/OpenLayers/Geometry tests/Layer
commits at openlayers.org
commits at openlayers.org
Mon Mar 5 14:07:53 EST 2007
Author: euzuro
Date: 2007-03-05 14:07:46 -0500 (Mon, 05 Mar 2007)
New Revision: 2330
Modified:
sandbox/vector-2.4/lib/OpenLayers/Geometry/Point.js
sandbox/vector-2.4/tests/Layer/test_MultiMap.html
Log:
updated multimap test. seems to work
Modified: sandbox/vector-2.4/lib/OpenLayers/Geometry/Point.js
===================================================================
--- sandbox/vector-2.4/lib/OpenLayers/Geometry/Point.js 2007-03-05 19:04:02 UTC (rev 2329)
+++ sandbox/vector-2.4/lib/OpenLayers/Geometry/Point.js 2007-03-05 19:07:46 UTC (rev 2330)
@@ -9,10 +9,15 @@
* @requires OpenLayers/Geometry.js
*/
OpenLayers.Geometry.Point = OpenLayers.Class.create();
-
OpenLayers.Geometry.Point.prototype =
OpenLayers.Class.inherit(OpenLayers.LonLat, OpenLayers.Geometry, {
+ /** @type float */
+ x: null,
+
+ /** @type float */
+ y: null,
+
/**
* @constructor
*
@@ -22,6 +27,7 @@
initialize: function(x, y) {
OpenLayers.LonLat.prototype.initialize.apply(this, arguments);
OpenLayers.Geometry.prototype.initialize.apply(this, arguments);
+
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
this.x = this.lon;
this.y = this.lat;
Modified: sandbox/vector-2.4/tests/Layer/test_MultiMap.html
===================================================================
--- sandbox/vector-2.4/tests/Layer/test_MultiMap.html 2007-03-05 19:04:02 UTC (rev 2329)
+++ sandbox/vector-2.4/tests/Layer/test_MultiMap.html 2007-03-05 19:07:46 UTC (rev 2330)
@@ -1,7 +1,7 @@
<html>
<head>
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
- <script src="../lib/OpenLayers.js"></script>
+ <script src="../../lib/OpenLayers.js"></script>
<script type="text/javascript"><!--
var layer;
@@ -18,7 +18,7 @@
t.eq( layer.name, "Goog Layer", "layer.name is correct" );
- t.ok ( layer.multimap != null, "MultiMap Object correctly loaded");
+ t.ok ( layer.mapObject != null, "MultiMap Object correctly loaded");
}
function test_02_Layer_MultiMap_isBaseLayer (t) {
@@ -29,29 +29,6 @@
t.ok(layer.isBaseLayer, "a default load of google layer responds as a base layer");
}
- function test_03_Layer_MultiMap_Translation_zoom (t) {
-
- t.plan( 4 );
-
- var map = new OpenLayers.Map('map');
- var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
- map.addLayer(layer);
-
- // these two lines specify an appropriate translation.
- // the code afterwards works by itself to test that translation
- // works correctly both ways.
- var gZoom = 5;
- var correspondingOLZoom = 4;
-
-
- olZoom = layer.getOLZoomFromMMZoom(gZoom);
- t.eq(olZoom, correspondingOLZoom, "Translation from GZoom to OL Zoom works");
- t.eq(layer.getMMZoomFromOLZoom(olZoom), gZoom, "Translation from OL Zoom to GZoom works");
-
- t.ok( layer.getMMZoomFromOLZoom(null) == null, "getGZoomFromOLZoom(null) returns null");
- t.ok( layer.getOLZoomFromMMZoom(null) == null, "getOLZoomFromGZoom(null) returns null");
- }
-
function test_04_Layer_MultiMap_Translation_lonlat (t) {
t.plan( 4 );
@@ -67,14 +44,14 @@
var correspondingOLLonLat = new OpenLayers.LonLat(100,50);
- olLonLat = layer.getOLLonLatFromMMLatLong(gLatLng);
+ olLonLat = layer.getOLLonLatFromMapObjectLonLat(gLatLng);
t.ok(olLonLat.equals(correspondingOLLonLat), "Translation from GLatLng to OpenLayers.LonLat works");
- var transGLatLng = layer.getMMLatLongFromOLLonLat(olLonLat);
+ var transGLatLng = layer.getMapObjectLonLatFromOLLonLat(olLonLat);
t.ok( (transGLatLng.lat == gLatLng.lat) && (transGLatLng.lon == transGLatLng.lon), "Translation from OpenLayers.LonLat to GLatLng works");
- t.ok( layer.getMMLatLongFromOLLonLat(null) == null, "getGLatLngFromOLLonLat(null) returns null");
- t.ok( layer.getOLLonLatFromMMLatLong(null) == null, "getOLLonLatFromGLatLng(null) returns null");
+ t.ok( layer.getMapObjectLonLatFromOLLonLat(null) == null, "getGLatLngFromOLLonLat(null) returns null");
+ t.ok( layer.getOLLonLatFromMapObjectLonLat(null) == null, "getOLLonLatFromGLatLng(null) returns null");
}
function test_05_Layer_MultiMap_Translation_pixel (t) {
@@ -92,14 +69,14 @@
var correspondingOLPixel = new OpenLayers.Pixel(50, 100);
- olPixel = layer.getOLPixelFromPixel(gPoint);
+ olPixel = layer.getOLPixelFromMapObjectPixel(gPoint);
t.ok( olPixel.equals(correspondingOLPixel), "Translation from GPoint to OpenLayers.Pixel works");
- var transGPoint = layer.getPixelFromOLPixel(olPixel);
+ var transGPoint = layer.getMapObjectPixelFromOLPixel(olPixel);
t.ok( ((transGPoint.x == transGPoint.x) && (transGPoint.y == transGPoint.y)), "Translation from OpenLayers.Pixel to GPoint works");
- t.ok( layer.getPixelFromOLPixel(null) == null, "getGPointFromOLPixel(null) returns null");
- t.ok( layer.getOLPixelFromPixel(null) == null, "getOLPixelFromGPoint(null) returns null");
+ t.ok( layer.getMapObjectPixelFromOLPixel(null) == null, "getGPointFromOLPixel(null) returns null");
+ t.ok( layer.getOLPixelFromMapObjectPixel(null) == null, "getOLPixelFromGPoint(null) returns null");
}
More information about the Commits
mailing list