r407@creusa: crschmidt | 2006-05-27 12:41:55 -0400

Commit changes to textfile, and also a change to the Layer.Text tests to actually test events and popups. This is failing in svk, but I think this is because of not having up to date Layer.Text -- forgot to svk pull before I left -- so I'll fix this once I'm no longer at 35000 feet.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@431 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-27 19:17:45 +00:00
parent ed8109ab46
commit f1093679f9
2 changed files with 19 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
point image
10,20 http://boston.openguides.org/markers/ORANGE.png
15,25 http://boston.openguides.org/markers/ORANGE.png

View File

@@ -13,7 +13,7 @@
t.eq( layer.location, "data_Layer_Text_textfile.txt", "layer.location is correct" );
var markers;
t.delay_call( 1, function() {
t.eq( layer.markers.length, 1, "marker length is correct" );
t.eq( layer.markers.length, 2, "marker length is correct" );
t.eq( layer.markers[0].lonlat.lat, 10, "latitude on first marker is correct" );
t.eq( layer.markers[0].lonlat.lon, 20, "latitude on first marker is correct" );
t.eq( layer.markers[0].icon.url, 'http://boston.openguides.org/markers/ORANGE.png', "icon" );
@@ -41,6 +41,23 @@
*/
});;
}
function test_03_Layer_Text_events (t) {
t.plan( 4 );
layer = new OpenLayers.Layer.Text('Test Layer', 'data_Layer_Text_textfile.txt');
var map = new OpenLayers.Map('map');
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0,0),0);
var event = {};
t.delay_call( 1, function() {
t.ok(layer.markers[0].events, "First marker has an events object");
t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object");
layer.markers[0].events.triggerEvent('click', event);
t.eq(map.popups.length, 1, "Popup opened correctly");
layer.markers[1].events.triggerEvent('click', event);
t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly");
});
}
function test_99_Layer_Text_destroy (t) {
t.plan( 1 );
layer = new OpenLayers.Layer.Text('Test Layer');