Your styleMap looks good. It is probably a projection problem.
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.
var my_layer = new OpenLayers.Layer.Vector("My Layer", {
styleMap: gangnam_style,
projection: 'EPSG:4326'
});
Matt Priour
On 1/7/2013 4:12 PM, Morescratch wrote:
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:
http://osgeo-org.1560.n6.nabble.com/StyleMap-for-vector-layer-tp5026037.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users