Skip to content

Commit 07fd731

Browse files
committed
Pullup Changes for 2.8 RC6.
* VML support for IE8 (Closes #1910) * Fix for Opera 9.27 support (Closes #2103) * Minor ArcXML change for exact renderer (Closes #2117) * Missing semicolons (Closes #2134) * vector labels in IE7 standards mode (Closes #2135) git-svn-id: http://svn.openlayers.org/branches/openlayers/2.8@9478 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
1 parent d250372 commit 07fd731

File tree

8 files changed

+145
-36
lines changed

8 files changed

+145
-36
lines changed

examples/wfs-protocol.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
var layer = new OpenLayers.Layer.Vector("WFS", {
2020
strategies: [new OpenLayers.Strategy.BBOX()],
2121
protocol: new OpenLayers.Protocol.WFS({
22-
url: "http://publicus.opengeo.org/geoserver/wfs",
22+
url: "http://demo.opengeo.org/geoserver/wfs",
2323
featureType: "tasmania_roads",
2424
featureNS: "http://www.openplans.org/topp"
2525
})

examples/wmst.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
1717
{layers: "landsat7"});
1818

19-
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
19+
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
2020

2121
jpl_wms.setVisibility(false);
2222

lib/OpenLayers/BaseTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ OpenLayers.String = {
162162
* Used to find tokens in a string.
163163
* Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
164164
*/
165-
tokenRegEx: /\${([\w.]+?)}/g,
165+
tokenRegEx: /\$\{([\w.]+?)\}/g,
166166

167167
/**
168168
* Property: OpenLayers.String.numberRegEx

lib/OpenLayers/Format/ArcXML.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ OpenLayers.Format.ArcXML = OpenLayers.Class(OpenLayers.Format.XML, {
557557
var keys = this.fontStyleKeys;
558558
for (var i = 0, len = keys.length; i < len; i++) {
559559
var key = keys[i];
560-
if (symbol[key]) {
561-
selem.setAttribute(key, renderer[key]);
560+
if (exact.symbol[key]) {
561+
selem.setAttribute(key, exact.symbol[key]);
562562
}
563563
}
564564
eelem.appendChild(selem);

lib/OpenLayers/Format/WMSGetFeatureInfo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
228228
var attributes = {};
229229
if (node.nodeType == 1) {
230230
var children = node.childNodes;
231-
n = children.length
231+
n = children.length;
232232
for (var i = 0; i < n; ++i) {
233233
var child = children[i];
234234
if (child.nodeType == 1) {

lib/OpenLayers/Renderer/VML.js

+35-29
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
5353
if (!document.namespaces.olv) {
5454
document.namespaces.add("olv", this.xmlns);
5555
var style = document.createStyleSheet();
56-
style.addRule('olv\\:*', "behavior: url(#default#VML); " +
57-
"position: absolute; display: inline-block;");
56+
var shapes = ['shape','rect', 'oval', 'fill', 'stroke', 'imagedata', 'group','textbox'];
57+
for (var i = 0, len = shapes.length; i < len; i++) {
58+
59+
style.addRule('olv\\:' + shapes[i], "behavior: url(#default#VML); " +
60+
"position: absolute; display: inline-block;");
61+
}
5862
}
5963

6064
OpenLayers.Renderer.Elements.prototype.initialize.apply(this,
@@ -111,14 +115,14 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
111115

112116

113117
var org = left + " " + top;
114-
this.root.setAttribute("coordorigin", org);
118+
this.root.coordorigin = org;
115119
var roots = [this.root, this.vectorRoot, this.textRoot];
116120
var root;
117121
for(var i=0, len=roots.length; i<len; ++i) {
118122
root = roots[i];
119123

120124
var size = this.size.w + " " + this.size.h;
121-
root.setAttribute("coordsize", size);
125+
root.coordsize = size;
122126

123127
}
124128
// flip the VML display Y axis upside down so it
@@ -240,11 +244,10 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
240244
options.isStroked = false;
241245
} else if (this.isComplexSymbol(style.graphicName)) {
242246
var cache = this.importSymbol(style.graphicName);
243-
node.setAttribute("path", cache.path);
244-
node.setAttribute("coordorigin", cache.left + "," +
245-
cache.bottom);
247+
node.path = cache.path;
248+
node.coordorigin = cache.left + "," + cache.bottom;
246249
var size = cache.size;
247-
node.setAttribute("coordsize", size + "," + size);
250+
node.coordsize = size + "," + size;
248251
this.drawCircle(node, geometry, style.pointRadius);
249252
node.style.flip = "y";
250253
} else {
@@ -254,9 +257,9 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
254257

255258
// fill
256259
if (options.isFilled) {
257-
node.setAttribute("fillcolor", style.fillColor);
260+
node.fillcolor = style.fillColor;
258261
} else {
259-
node.setAttribute("filled", "false");
262+
node.filled = "false";
260263
}
261264
var fills = node.getElementsByTagName("fill");
262265
var fill = (fills.length == 0) ? null : fills[0];
@@ -268,18 +271,18 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
268271
if (!fill) {
269272
fill = this.createNode('olv:fill', node.id + "_fill");
270273
}
271-
fill.setAttribute("opacity", style.fillOpacity);
274+
fill.opacity = style.fillOpacity;
272275

273276
if (node._geometryClass == "OpenLayers.Geometry.Point" &&
274277
style.externalGraphic) {
275278

276279
// override fillOpacity
277280
if (style.graphicOpacity) {
278-
fill.setAttribute("opacity", style.graphicOpacity);
281+
fill.opacity = style.graphicOpacity;
279282
}
280283

281-
fill.setAttribute("src", style.externalGraphic);
282-
fill.setAttribute("type", "frame");
284+
fill.src = style.externalGraphic;
285+
fill.type = "frame";
283286

284287
if (!(style.graphicWidth && style.graphicHeight)) {
285288
fill.aspect = "atmost";
@@ -298,18 +301,18 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
298301
// the graphic as imagedata element. We cannot just remove
299302
// the fill, because this is part of the hack described
300303
// in graphicRotate
301-
fill.setAttribute("opacity", 0);
304+
fill.opacity = 0;
302305
} else {
303306
node.style.rotation = style.rotation;
304307
}
305308
}
306309

307310
// stroke
308311
if (options.isStroked) {
309-
node.setAttribute("strokecolor", style.strokeColor);
310-
node.setAttribute("strokeweight", style.strokeWidth + "px");
312+
node.strokecolor = style.strokeColor;
313+
node.strokeweight = style.strokeWidth + "px";
311314
} else {
312-
node.setAttribute("stroked", "false");
315+
node.stroked = false;
313316
}
314317
var strokes = node.getElementsByTagName("stroke");
315318
var stroke = (strokes.length == 0) ? null : strokes[0];
@@ -322,9 +325,9 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
322325
stroke = this.createNode('olv:stroke', node.id + "_stroke");
323326
node.appendChild(stroke);
324327
}
325-
stroke.setAttribute("opacity", style.strokeOpacity);
326-
stroke.setAttribute("endcap", !style.strokeLinecap || style.strokeLinecap == 'butt' ? 'flat' : style.strokeLinecap);
327-
stroke.setAttribute("dashstyle", this.dashStyle(style));
328+
stroke.opacity = style.strokeOpacity;
329+
stroke.endcap = !style.strokeLinecap || style.strokeLinecap == 'butt' ? 'flat' : style.strokeLinecap;
330+
stroke.dashstyle = this.dashStyle(style);
328331
}
329332

330333
if (style.cursor != "inherit" && style.cursor != null) {
@@ -453,12 +456,12 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
453456
var fillColor = node._style.fillColor;
454457
var strokeColor = node._style.strokeColor;
455458
if (fillColor == "none" &&
456-
node.getAttribute("fillcolor") != fillColor) {
457-
node.setAttribute("fillcolor", fillColor);
459+
node.fillcolor != fillColor) {
460+
node.fillcolor = fillColor;
458461
}
459462
if (strokeColor == "none" &&
460-
node.getAttribute("strokecolor") != strokeColor) {
461-
node.setAttribute("strokecolor", strokeColor);
463+
node.strokecolor != strokeColor) {
464+
node.strokecolor = strokeColor;
462465
}
463466
},
464467

@@ -544,12 +547,12 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
544547
createNode: function(type, id) {
545548
var node = document.createElement(type);
546549
if (id) {
547-
node.setAttribute('id', id);
550+
node.id = id;
548551
}
549552

550553
// IE hack to make elements unselectable, to prevent 'blue flash'
551554
// while dragging vectors; #1410
552-
node.setAttribute('unselectable', 'on', 0);
555+
node.unselectable = 'on';
553556
node.onselectstart = function() { return(false); };
554557

555558
return node;
@@ -816,7 +819,10 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
816819
textbox.style.fontWeight = style.fontWeight;
817820
}
818821
textbox.style.whiteSpace = "nowrap";
819-
textbox.inset = "0px,0px,0px,0px";
822+
// fun with IE: IE7 in standards compliant mode does not display any
823+
// text with a left inset of 0. So we set this to 1px and subtract one
824+
// pixel later when we set label.style.left
825+
textbox.inset = "1px,0px,0px,0px";
820826

821827
if(!label.parentNode) {
822828
label.appendChild(textbox);
@@ -828,7 +834,7 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
828834
(OpenLayers.Renderer.VML.LABEL_SHIFT[align.substr(0,1)]);
829835
var yshift = textbox.clientHeight *
830836
(OpenLayers.Renderer.VML.LABEL_SHIFT[align.substr(1,1)]);
831-
label.style.left = parseInt(label.style.left)-xshift+"px";
837+
label.style.left = parseInt(label.style.left)-xshift-1+"px";
832838
label.style.top = parseInt(label.style.top)+yshift+"px";
833839
},
834840

lib/OpenLayers/Style.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ OpenLayers.Style = OpenLayers.Class({
207207
var defaults = this.defaultStyle;
208208
OpenLayers.Util.applyDefaults(symbolizer, {
209209
pointRadius: defaults.pointRadius
210-
})
210+
});
211211
if(symbolizer.stroke === true || symbolizer.graphic === true) {
212212
OpenLayers.Util.applyDefaults(symbolizer, {
213213
strokeWidth: defaults.strokeWidth,

tests/manual/arcims-2117.html

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<html xmlns="http://www.w3.org/1999/xhtml">
2+
<head>
3+
<title>ArcIMS Test Ticket #2117</title>
4+
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5+
<link rel="stylesheet" href="../../examples/style.css" type="text/css" />
6+
<script src="../../lib/OpenLayers.js"></script>
7+
<script type="text/javascript">
8+
var lon = 0;
9+
var lat = 0;
10+
var zoom = 1;
11+
var map, layer;
12+
13+
function init(){
14+
OpenLayers.ProxyHost = "../../examples/proxy.cgi?url=";
15+
16+
map = new OpenLayers.Map( 'map' );
17+
18+
var options = {
19+
serviceName: "OpenLayers_Sample",
20+
async: true,
21+
layers: [{
22+
id:1,
23+
visible:'true',
24+
/*query:{
25+
where: '1=1',
26+
spatialfilter: true
27+
},*/
28+
renderer:{
29+
type: 'valuemaplabel',
30+
lookupfield: 'FIPS_ID',
31+
labelfield: 'FIPS_CNTRY',
32+
exacts:[{
33+
value: '227',
34+
symbol: {
35+
type: 'text',
36+
antialiasing: 'true',
37+
interval: 6,
38+
blockout: '255,255,255',
39+
font: 'Arial',
40+
fontcolor: '0,0,0',
41+
fontsize: 11,
42+
transparency: 0.7
43+
}
44+
},{
45+
value: '150',
46+
symbol: {
47+
type: 'text',
48+
antialiasing: 'true',
49+
interval: 6,
50+
blockout: '255,255,255',
51+
font: 'Arial',
52+
fontcolor: '0,0,0',
53+
fontsize: 11,
54+
transparency: 0.7
55+
}
56+
},{
57+
value: '75',
58+
symbol: {
59+
type: 'text',
60+
antialiasing: 'true',
61+
interval: 6,
62+
blockout: '255,255,255',
63+
font: 'Arial',
64+
fontcolor: '0,0,0',
65+
fontsize: 11,
66+
transparency: 0.7
67+
}
68+
}]
69+
}
70+
}]
71+
};
72+
73+
layer = new OpenLayers.Layer.ArcIMS( "Global Sample Map",
74+
"http://sample.avencia.com/servlet/com.esri.esrimap.Esrimap", options );
75+
map.addLayer(layer);
76+
77+
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
78+
map.addControl( new OpenLayers.Control.LayerSwitcher() );
79+
}
80+
</script>
81+
</head>
82+
<body onload="init()">
83+
<h1 id="title">ArcIMS Test Ticket #2117</h1>
84+
85+
<div id="tags">
86+
</div>
87+
<p id="shortdesc">
88+
<a href="http://trac.openlayers.org/ticket/2117">Testing ticket #2117</a>
89+
</p>
90+
91+
<div id="map" class="smallmap"></div>
92+
93+
<div id="docs">
94+
This is an example of a bug in the ArcXML format writer.
95+
If you don't see a map, it's broken.
96+
</div>
97+
98+
</body>
99+
</html>
100+
101+
102+
103+

0 commit comments

Comments
 (0)