Replacing Tabs with Spaces. (See #988)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4356 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -140,25 +140,25 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_04_Layer_GeoRSS_icon(t) {
|
function test_04_Layer_GeoRSS_icon(t) {
|
||||||
t.plan( 3 );
|
t.plan( 3 );
|
||||||
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt);
|
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt);
|
||||||
var the_icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png');
|
var the_icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png');
|
||||||
var otherLayer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt,{icon:the_icon});
|
var otherLayer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt,{icon:the_icon});
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
||||||
"http://octo.metacarta.com/cgi-bin/mapserv?",
|
"http://octo.metacarta.com/cgi-bin/mapserv?",
|
||||||
{map: "/mapdata/vmap_wms.map", layers: "basic"});
|
{map: "/mapdata/vmap_wms.map", layers: "basic"});
|
||||||
map.addLayer(baseLayer);
|
map.addLayer(baseLayer);
|
||||||
map.addLayers([layer,otherLayer]);
|
map.addLayers([layer,otherLayer]);
|
||||||
map.setCenter(new OpenLayers.LonLat(0,0),0);
|
map.setCenter(new OpenLayers.LonLat(0,0),0);
|
||||||
var defaultIcon = OpenLayers.Marker.defaultIcon();
|
var defaultIcon = OpenLayers.Marker.defaultIcon();
|
||||||
t.delay_call( 1, function() {
|
t.delay_call( 1, function() {
|
||||||
t.ok(layer.markers[0].icon, "The layer has a icon");
|
t.ok(layer.markers[0].icon, "The layer has a icon");
|
||||||
t.eq(layer.markers[0].icon.url, defaultIcon.url, "The layer without icon has the default icon.");
|
t.eq(layer.markers[0].icon.url, defaultIcon.url, "The layer without icon has the default icon.");
|
||||||
t.eq(otherLayer.markers[0].icon.url, the_icon.url,"The layer with an icon has that icon.");
|
t.eq(otherLayer.markers[0].icon.url, the_icon.url,"The layer with an icon has that icon.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function test_Layer_GeoRSS_loadend_Event(t) {
|
function test_Layer_GeoRSS_loadend_Event(t) {
|
||||||
var browserCode = OpenLayers.Util.getBrowserName();
|
var browserCode = OpenLayers.Util.getBrowserName();
|
||||||
if (browserCode == "msie") {
|
if (browserCode == "msie") {
|
||||||
|
|||||||
@@ -515,10 +515,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_16_Layer_Grid_tileSizeIsInteger(t) {
|
function test_16_Layer_Grid_tileSizeIsInteger(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var layer = new OpenLayers.Layer.Grid(name, url, params, {
|
var layer = new OpenLayers.Layer.Grid(name, url, params, {
|
||||||
singleTile: true,
|
singleTile: true,
|
||||||
ratio: 1.5
|
ratio: 1.5
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
}
|
}
|
||||||
function test_Layer_Text_loadend_Event(t) {
|
function test_Layer_Text_loadend_Event(t) {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
layer = new OpenLayers.Layer.Text('Test Layer', {location:datafile});
|
layer = new OpenLayers.Layer.Text('Test Layer', {location:datafile});
|
||||||
t.delay_call(2, function() {
|
t.delay_call(2, function() {
|
||||||
layer.events.register('loadend', layer, function() {
|
layer.events.register('loadend', layer, function() {
|
||||||
t.ok(true, "Loadend event fired");
|
t.ok(true, "Loadend event fired");
|
||||||
|
|||||||
@@ -165,9 +165,9 @@
|
|||||||
var baseLayer = new OpenLayers.Layer.WMS("Base Layer",
|
var baseLayer = new OpenLayers.Layer.WMS("Base Layer",
|
||||||
"http://octo.metacarta.com/cgi-bin/mapserv",
|
"http://octo.metacarta.com/cgi-bin/mapserv",
|
||||||
{ map: '/mapdata/vmap_wms.map',
|
{ map: '/mapdata/vmap_wms.map',
|
||||||
layers: 'basic',
|
layers: 'basic',
|
||||||
format: 'image/png'});
|
format: 'image/png'});
|
||||||
|
|
||||||
var layer = new OpenLayers.Layer.Vector("Test Layer");
|
var layer = new OpenLayers.Layer.Vector("Test Layer");
|
||||||
var renderer = layer.renderer;
|
var renderer = layer.renderer;
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
@@ -181,25 +181,25 @@
|
|||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
var customStyle1 = new Object({
|
var customStyle1 = new Object({
|
||||||
externalGraphic: 'test.png',
|
externalGraphic: 'test.png',
|
||||||
pointRadius: 10
|
pointRadius: 10
|
||||||
});
|
});
|
||||||
var customStyle2 = new Object({
|
var customStyle2 = new Object({
|
||||||
externalGraphic: 'test.png',
|
externalGraphic: 'test.png',
|
||||||
graphicWidth: 12
|
graphicWidth: 12
|
||||||
});
|
});
|
||||||
var customStyle3 = new Object({
|
var customStyle3 = new Object({
|
||||||
externalGraphic: 'test.png',
|
externalGraphic: 'test.png',
|
||||||
graphicHeight: 14
|
graphicHeight: 14
|
||||||
});
|
});
|
||||||
var customStyle4 = new Object({
|
var customStyle4 = new Object({
|
||||||
externalGraphic: 'test.png',
|
externalGraphic: 'test.png',
|
||||||
graphicWidth: 24,
|
graphicWidth: 24,
|
||||||
graphicHeight: 16
|
graphicHeight: 16
|
||||||
});
|
});
|
||||||
var customStyle5 = new Object({
|
var customStyle5 = new Object({
|
||||||
externalGraphic: 'test.png',
|
externalGraphic: 'test.png',
|
||||||
graphicWidth: 24,
|
graphicWidth: 24,
|
||||||
graphicOpacity: 1
|
graphicOpacity: 1
|
||||||
});
|
});
|
||||||
var customStyle6 = new Object({
|
var customStyle6 = new Object({
|
||||||
@@ -212,43 +212,43 @@
|
|||||||
|
|
||||||
var root = renderer.root;
|
var root = renderer.root;
|
||||||
if (layer.renderer.CLASS_NAME == 'OpenLayers.Renderer.SVG') {
|
if (layer.renderer.CLASS_NAME == 'OpenLayers.Renderer.SVG') {
|
||||||
feature.style = customStyle1;
|
feature.style = customStyle1;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
||||||
(2*customStyle1.pointRadius).toString(),
|
(2*customStyle1.pointRadius).toString(),
|
||||||
"given a pointRadius, width equals 2*pointRadius");
|
"given a pointRadius, width equals 2*pointRadius");
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
||||||
(2*customStyle1.pointRadius).toString(),
|
(2*customStyle1.pointRadius).toString(),
|
||||||
"given a pointRadius, height equals 2*pointRadius");
|
"given a pointRadius, height equals 2*pointRadius");
|
||||||
feature.style = customStyle2;
|
feature.style = customStyle2;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
||||||
root.firstChild.getAttributeNS(null, 'height'),
|
root.firstChild.getAttributeNS(null, 'height'),
|
||||||
"given a graphicWidth, width equals height");
|
"given a graphicWidth, width equals height");
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
||||||
customStyle2.graphicWidth.toString(),
|
customStyle2.graphicWidth.toString(),
|
||||||
"width is set correctly");
|
"width is set correctly");
|
||||||
feature.style = customStyle3;
|
feature.style = customStyle3;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
||||||
root.firstChild.getAttributeNS(null, 'width'),
|
root.firstChild.getAttributeNS(null, 'width'),
|
||||||
"given a graphicHeight, height equals width");
|
"given a graphicHeight, height equals width");
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
||||||
customStyle3.graphicHeight.toString(),
|
customStyle3.graphicHeight.toString(),
|
||||||
"height is set correctly");
|
"height is set correctly");
|
||||||
feature.style = customStyle4;
|
feature.style = customStyle4;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
t.eq(root.firstChild.getAttributeNS(null, 'height'),
|
||||||
customStyle4.graphicHeight.toString(),
|
customStyle4.graphicHeight.toString(),
|
||||||
"given graphicHeight and graphicWidth, both are set: height");
|
"given graphicHeight and graphicWidth, both are set: height");
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
t.eq(root.firstChild.getAttributeNS(null, 'width'),
|
||||||
customStyle4.graphicWidth.toString(),
|
customStyle4.graphicWidth.toString(),
|
||||||
"given graphicHeight and graphicWidth, both are set: width");
|
"given graphicHeight and graphicWidth, both are set: width");
|
||||||
feature.style = customStyle5;
|
feature.style = customStyle5;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.getAttributeNS(null, 'style'),
|
t.eq(root.firstChild.getAttributeNS(null, 'style'),
|
||||||
'opacity: '+customStyle5.graphicOpacity.toString()+';',
|
'opacity: '+customStyle5.graphicOpacity.toString()+';',
|
||||||
"graphicOpacity correctly set");
|
"graphicOpacity correctly set");
|
||||||
feature.style = customStyle6;
|
feature.style = customStyle6;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
var x = geometryX / renderer.getResolution() + renderer.left;
|
var x = geometryX / renderer.getResolution() + renderer.left;
|
||||||
@@ -268,46 +268,46 @@
|
|||||||
"graphicYOffset correctly set");
|
"graphicYOffset correctly set");
|
||||||
}
|
}
|
||||||
if (layer.renderer.CLASS_NAME == 'OpenLayers.Renderer.VML') {
|
if (layer.renderer.CLASS_NAME == 'OpenLayers.Renderer.VML') {
|
||||||
feature.style = customStyle1;
|
feature.style = customStyle1;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.style.width,
|
t.eq(root.firstChild.style.width,
|
||||||
(2*customStyle1.pointRadius).toString()+'px',
|
(2*customStyle1.pointRadius).toString()+'px',
|
||||||
"given a pointRadius, width equals 2*pointRadius");
|
"given a pointRadius, width equals 2*pointRadius");
|
||||||
t.eq(root.firstChild.style.height,
|
t.eq(root.firstChild.style.height,
|
||||||
(2*customStyle1.pointRadius).toString()+'px',
|
(2*customStyle1.pointRadius).toString()+'px',
|
||||||
"given a pointRadius, height equals 2*pointRadius");
|
"given a pointRadius, height equals 2*pointRadius");
|
||||||
feature.style = customStyle2;
|
feature.style = customStyle2;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.style.width,
|
t.eq(root.firstChild.style.width,
|
||||||
root.firstChild.style.height,
|
root.firstChild.style.height,
|
||||||
"given a graphicWidth, width equals height");
|
"given a graphicWidth, width equals height");
|
||||||
t.eq(root.firstChild.style.width,
|
t.eq(root.firstChild.style.width,
|
||||||
customStyle2.graphicWidth.toString()+'px',
|
customStyle2.graphicWidth.toString()+'px',
|
||||||
"width is set correctly");
|
"width is set correctly");
|
||||||
feature.style = customStyle3;
|
feature.style = customStyle3;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.style.height,
|
t.eq(root.firstChild.style.height,
|
||||||
root.firstChild.style.width,
|
root.firstChild.style.width,
|
||||||
"given a graphicHeight, height equals width");
|
"given a graphicHeight, height equals width");
|
||||||
t.eq(root.firstChild.style.height,
|
t.eq(root.firstChild.style.height,
|
||||||
customStyle3.graphicHeight.toString()+'px',
|
customStyle3.graphicHeight.toString()+'px',
|
||||||
"height is set correctly");
|
"height is set correctly");
|
||||||
feature.style = customStyle4;
|
feature.style = customStyle4;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
t.eq(root.firstChild.style.height,
|
t.eq(root.firstChild.style.height,
|
||||||
customStyle4.graphicHeight.toString()+'px',
|
customStyle4.graphicHeight.toString()+'px',
|
||||||
"given graphicHeight and graphicWidth, both are set: height");
|
"given graphicHeight and graphicWidth, both are set: height");
|
||||||
t.eq(root.firstChild.style.width,
|
t.eq(root.firstChild.style.width,
|
||||||
customStyle4.graphicWidth.toString()+'px',
|
customStyle4.graphicWidth.toString()+'px',
|
||||||
"given graphicHeight and graphicWidth, both are set: width");
|
"given graphicHeight and graphicWidth, both are set: width");
|
||||||
feature.style = customStyle5;
|
feature.style = customStyle5;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
var fill = root.firstChild.getElementsByTagName("fill")[0];
|
var fill = root.firstChild.getElementsByTagName("fill")[0];
|
||||||
if (fill == null) fill = root.firstChild.getElementsByTagName("v:fill");
|
if (fill == null) fill = root.firstChild.getElementsByTagName("v:fill");
|
||||||
var opacity = fill.getAttribute('opacity');
|
var opacity = fill.getAttribute('opacity');
|
||||||
t.eq(opacity,
|
t.eq(opacity,
|
||||||
customStyle5.graphicOpacity,
|
customStyle5.graphicOpacity,
|
||||||
"graphicOpacity correctly set");
|
"graphicOpacity correctly set");
|
||||||
feature.style = customStyle6;
|
feature.style = customStyle6;
|
||||||
layer.drawFeature(feature);
|
layer.drawFeature(feature);
|
||||||
var x = geometryX / renderer.getResolution();
|
var x = geometryX / renderer.getResolution();
|
||||||
|
|||||||
Reference in New Issue
Block a user