Thanks for the reply. I&#39;ve tried that without any success.  using Chrome developers tool i receive the following error but have no idea what that means. <div><br></div><div><div class="console-message console-other-source console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding-top: 1px; padding-right: 22px; padding-bottom: 1px; padding-left: 24px; min-height: 16px; display: block; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px; ">
<span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px !important; color: red; "><span style="box-sizing: border-box; ">Failed to load resource</span></span></div>
<div class="console-message console-js-source console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding-top: 1px; padding-right: 22px; padding-bottom: 1px; padding-left: 24px; min-height: 16px; display: block; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px; ">
<span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px !important; color: red; "><span style="box-sizing: border-box; ">XMLHttpRequest cannot load .../openlayers/projects.gml. Cross origin requests are only supported for HTTP.</span></span></div>
<div class="console-message console-js-source console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding-top: 1px; padding-right: 22px; padding-bottom: 1px; padding-left: 24px; min-height: 16px; display: block; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px; ">
<a href="http://dev.openlayers.org/releases/OpenLayers-2.10/lib/OpenLayers/Request/XMLHttpRequest.js" class="console-message-url webkit-html-resource-link" title="http://dev.openlayers.org/releases/OpenLayers-2.10/lib/OpenLayers/Request/XMLHttpRequest.js" style="box-sizing: border-box; float: right; color: rgb(84, 84, 84); cursor: pointer; ">XMLHttpRequest.js:222</a><span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px !important; color: red; "><span style="box-sizing: border-box; ">Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101</span></span></div>
<div class="console-message console-js-source console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding-top: 1px; padding-right: 22px; padding-bottom: 1px; padding-left: 24px; min-height: 16px; display: block; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px; ">
<span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px !important; color: red; "><span style="box-sizing: border-box; ">XMLHttpRequest cannot load .../openlayers/MASTS.gml. Cross origin requests are only supported for HTTP.</span></span></div>
<div class="console-message console-js-source console-error-level" style="box-sizing: border-box; position: relative; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(240, 240, 240); padding-top: 1px; padding-right: 22px; padding-bottom: 1px; padding-left: 24px; min-height: 16px; display: block; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px; ">
<span class="console-message-text source-code" style="box-sizing: border-box; white-space: pre-wrap; font-family: Consolas, &#39;Lucida Console&#39;, monospace; font-size: 12px !important; color: red; "><span style="box-sizing: border-box; ">Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101</span></span></div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Aris</div><div class="gmail_quote"><br></div><div class="gmail_quote">On 22 February 2011 15:05, Christian Mayer <span dir="ltr">&lt;<a href="mailto:mayer@terrestris.de">mayer@terrestris.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  
    
  
  <div 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>
      
      
      <div>
        <div><br>
        </div>
      </div>
    </div>
    <br>
    Am 21.02.2011 08:44, schrieb adimopoulos:
    <div><div></div><div class="h5"><blockquote type="cite">
      <pre>Hi again

Just to update my previous post. I&#39;m placing here the parts of my code. Hope
someone can help....

        // Add a masts file
                var layer1 = new OpenLayers.Layer.GML(&quot;MASTS&quot;, &quot;MASTS.gml&quot;,{
                        projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;) ,
                        styleMap: myStyleMap,
                rendererOptions: {zIndexing: true}

                });              
        // Add a projects file
                var layer2 = new OpenLayers.Layer.GML(&quot;projects&quot;, &quot;./projects.gml&quot;,{
                        projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),
                        formatOptions: {
              extractStyles: true, 
              extractAttributes: true,
              maxDepth: 2
            },
                        styleMap: myStyleMap2,
                rendererOptions: {zIndexing: true}

                });              

and my stile 

        var myStyleMap = new OpenLayers.StyleMap( {
            &quot;default&quot;:new OpenLayers.Style({
            fillColor: &#39;${color1}&#39;, strokeColor: &#39;black&#39;, strokeOpacity:
0.8, strokeWidth: 0.8, fillOpacity: 0.8, pointRadius: &quot;${radius}&quot; },
                                //call attribute of style in order to modify
                         {
                               context: {
                                        color1: function(feature) {
                                                               
if(feature.attributes.Status == &quot;DEAD&quot;)
                                                                    {
                                                                       
selectedColor = &quot;red&quot;;
                                                                    }
                                                                else 
                                                                    {
                                                                       
selectedColor = &quot;green&quot;;
                                                                    } 
                                                                                                                                        return selectedColor;
                                                },
                                                                                radius: function(feature) {
                                                                                                                        return Math.min(Math.pow(Math.max(feature.attributes.Mean_u,
5), 1.9)*0.2, 13);
                                                                                }
                                                                }
                        }),
                        &quot;select&quot;:new OpenLayers.Style({
                                fillColor: &#39;#66ccff&#39;, strokeColor: &#39;black&#39;,
strokeOpacity: 1, fillOpacity: 0.7, pointRadius: &quot;5px&quot; })
                });
        // projects style        
        var myStyleMap2 = new OpenLayers.StyleMap( {
                        &quot;default&quot;: new OpenLayers.Style({
                                fillColor: &#39;blue&#39;, strokeColor: &#39;#3399ff&#39;,
strokeOpacity: 1, fillOpacity: 0.5 }),
                                                &quot;select&quot;: new OpenLayers.Style({
                                fillColor: &#39;#66ccff&#39;, strokeColor:
&#39;#3399ff&#39;, strokeOpacity: 1, fillOpacity: 0.5 })
        });


</pre>
    </blockquote>
  </div></div></div>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br></div>