<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <big>Your styleMap looks good. It is probably a projection problem.<br>
      If your features have their geometry defined in WGS84 Lon Lat
      coordinates, but the base map layer is OSM, Mapquest, Google, Bing
      or other web mercator tiles, then you need to add the 'projection'
      option to your vector layer definition.<br>
      <br>
    </big>
    <pre wrap=""><big>var my_layer = new OpenLayers.Layer.Vector("My Layer", { 
styleMap: gangnam_style,
projection: 'EPSG:4326'
});

Matt Priour</big>
</pre>
    <br>
    <br>
    <div class="moz-cite-prefix">On 1/7/2013 4:12 PM, Morescratch wrote:<br>
    </div>
    <blockquote cite="mid:1357596735921-5026037.post@n6.nabble.com"
      type="cite">
      <pre wrap="">Hi all,

I am missing something relevant in my code. I can't get a Vector layers to
use a StyleMap. Here is the offending code:

var gangnam_style = new OpenLayers.StyleMap({ 
  "default": new OpenLayers.Style( 
   { 
      strokeColor: "#990000", 
      fillColor: "#990000"
    }) 
});     

var my_layer = new OpenLayers.Layer.Vector("My Layer", { styleMap:
gangnam_style });

Any ideas on what I am missing?



--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.n6.nabble.com/StyleMap-for-vector-layer-tp5026037.html">http://osgeo-org.1560.n6.nabble.com/StyleMap-for-vector-layer-tp5026037.html</a>
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>