<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
I am not quite sure if this is the solution but maybe you try:<br>
<br>
put the instanciation of the stylemap objects (myStyleMap,
myStyleMap2) and before you use them. JSLint gives me warnings
about that. Maybe this is the problem.<br>
<br>
Best regards,<br>
Chris<br>
<br>
<div class="moz-signature">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style type="text/css">
#signature {
color: #333 !important;
font-family: monospace;
                        font-size: 12px;
padding: 10px;
line-height: 1.5em;
}
#highlight-container {
padding: 5px;
width: 450px;
margin: 30px 0;
border-width: 0px 0 0px 0;
border-right-width: 0;
border-left-width: 0;
border-style: dotted;
border-color: #333;
}
#signature a,
#signature a:link,
#signature a:visited,
#signature a:hover,
#signature a:active {
color: darkblue !important;
}
#signature address {
font-style: normal;
}
#col-container {
width: 550px;
}
#col-1 {
width: 180px; float: left;
}
#col-2 {
width: 320px; float: left;
}
#col-clear {
clear: both; padding-top: 30px;
}
#signature img {
margin-top:10px;
}
#col-container p,
#col-container address {
margin: 4px 0 0 0;
}
#signature .no-margin {
margin: 0;
}
</style>
<div id="signature">
<div id="col-container"><br>
</div>
</div>
</div>
<br>
Am 21.02.2011 08:44, schrieb adimopoulos:
<blockquote cite="mid:1298274251651-6047830.post@n2.nabble.com"
type="cite">
<pre wrap="">
Hi again
Just to update my previous post. I'm placing here the parts of my code. Hope
someone can help....
        // Add a masts file
                var layer1 = new OpenLayers.Layer.GML("MASTS", "MASTS.gml",{
                        projection: new OpenLayers.Projection("EPSG:4326") ,
                        styleMap: myStyleMap,
rendererOptions: {zIndexing: true}
                });
        // Add a projects file
                var layer2 = new OpenLayers.Layer.GML("projects", "./projects.gml",{
                        projection: new OpenLayers.Projection("EPSG:4326"),
                        formatOptions: {
extractStyles: true,
extractAttributes: true,
maxDepth: 2
},
                        styleMap: myStyleMap2,
rendererOptions: {zIndexing: true}
                });
and my stile
        var myStyleMap = new OpenLayers.StyleMap( {
"default":new OpenLayers.Style({
fillColor: '${color1}', strokeColor: 'black', strokeOpacity:
0.8, strokeWidth: 0.8, fillOpacity: 0.8, pointRadius: "${radius}" },
//call attribute of style in order to modify
{
context: {
color1: function(feature) {
if(feature.attributes.Status == "DEAD")
{
selectedColor = "red";
}
else
{
selectedColor = "green";
}
                                                                                                                                        return selectedColor;
},
                                                                                radius: function(feature) {
                                                                                                                        return Math.min(Math.pow(Math.max(feature.attributes.Mean_u,
5), 1.9)*0.2, 13);
                                                                                }
                                                                }
                        }),
                        "select":new OpenLayers.Style({
fillColor: '#66ccff', strokeColor: 'black',
strokeOpacity: 1, fillOpacity: 0.7, pointRadius: "5px" })
                });
        // projects style        
        var myStyleMap2 = new OpenLayers.StyleMap( {
"default": new OpenLayers.Style({
fillColor: 'blue', strokeColor: '#3399ff',
strokeOpacity: 1, fillOpacity: 0.5 }),
                                                "select": new OpenLayers.Style({
fillColor: '#66ccff', strokeColor:
'#3399ff', strokeOpacity: 1, fillOpacity: 0.5 })
        });
</pre>
</blockquote>
</body>
</html>