<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008>var vectorStyleMap = new
OpenLayers.StyleMap({</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008>
fillColor:'white',</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008>
strokeColor:'red',</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008> strokeWidth:1</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008>});</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=663280616-24112008>var vector_layer = ne OpenLayers.Layer.Vector("My layer
Name",{styleMap:vectorStyleMap});</SPAN></FONT></DIV><FONT face=Arial
color=#0000ff size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <B>On Behalf Of </B>Toby
Rainthorpe<BR><B>Sent:</B> Monday, November 24, 2008 9:39 AM<BR><B>To:</B>
users@openlayers.org<BR><B>Subject:</B> [OpenLayers-Users] Simple Styling
Problem<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>It still does not seem to work with the test I sent. I have
tried </DIV>
<DIV><BR></DIV>
<DIV>
<DIV><B>vector_layer = new OpenLayers.Layer.Vector(</B></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"><B></B></SPAN><B>{styleMap: new
OpenLayers.StyleMap({fillColor: "#991605"})</B></DIV>
<DIV><B>);</B></DIV></DIV>
<DIV><BR></DIV>
<DIV>And also:</DIV>
<DIV><BR></DIV>
<DIV><B>map.addLayer(vector_layer,</B></DIV>
<DIV><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"><B></B></SPAN><B>{styleMap: new
OpenLayers.StyleMap({fillColor: "#991605"})</B></DIV>
<DIV><B>);</B></DIV>
<DIV><BR></DIV>
<DIV>And also:</DIV>
<DIV><BR></DIV>
<DIV><B>vector_layer.addFeatures(geojson_format.read(test_territory), {styleMap:
new OpenLayers.StyleMap({fillColor: "#991605"}));</B></DIV>
<DIV><BR></DIV>
<DIV>None of which work. Please can you edit my example, or provide an example
as nothing seems to be working for me.</DIV>
<DIV><BR></DIV>
<DIV>Thanks for your help,</DIV>
<DIV><BR></DIV>
<DIV>Toby</DIV>
<DIV><BR></DIV>
<DIV><BR>-----Original Message-----</DIV>Add a styleMap to your vector layer
options parameter.<BR>{styleMap: new OpenLayers.StyleMap({bla bla
bla})} <BR><BR>-----Original Message-----<BR>From:
users-bounces@openlayers.org [<A
href="mailto:users-bounces@openlayers.org">mailto:users-bounces@openlayers.org</A>]<BR>On
Behalf Of Toby Rainthorpe<BR>Sent: Monday, November 24, 2008 6:12
AM<BR>To: <A
href="mailto:users@openlayers.org">users@openlayers.org</A><BR>Subject:
[OpenLayers-Users] Simple Styling Problem<BR><BR>Given the simple test below,
does anyone know how I would style the<BR>test_territory polygon? Or for that
matter the whole of the<BR>vector_layer?<BR><BR>Thanks for your
help,<BR><BR>Toby<BR><BR><html xmlns="<A
href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><BR> <head><BR> <link
rel="stylesheet" href="../theme/default/style.css" <BR>type="text/css"
/><BR> <link rel="stylesheet" href="style.css"
type="text/css" /><BR> <script
src="../lib/OpenLayers.js"></script><BR> <script
type="text/javascript"><BR> var lon =
0.30271;<BR> var lat =
53.29408;<BR> var zoom =
8;<BR> var map,
layer;<BR><BR> function
init(){<BR> map
= new OpenLayers.Map( 'map'
);<BR> layer
= new OpenLayers.Layer.WMS( "OpenLayers
WMS",<BR> "<A
href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</A>",<BR> {layers:
'basic'}
);<BR> map.addLayer(layer);<BR> map.setCenter(new
OpenLayers.LonLat(lon, lat), zoom);<BR><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN><SPAN class=Apple-tab-span
style="WHITE-SPACE: pre"></SPAN><BR> var
test_territory =
{"type":"Polygon","coordinates": <BR>[[[0.30271,53.29408],[0.32185,53.27152],[0.23484,53.19422],<BR>[0.19443,53.21331],[0.16971,53.21241],[0.08345,53.23488],<BR>[0.02083,53.24781],[-0.01269,53.17102],[-0.13717,53.14185],<BR>[-0.15075,53.12439],[-0.13071,53.02398],[-0.22929,53.00390],<BR>[-0.33850,53.06091],[-0.40868,53.05562],[-0.45224,53.05795],<BR>[-0.48515,53.12857],[-0.52103,53.14277],[-0.54183,53.19215],<BR>[-0.49520,53.22299],[-0.48566,53.22575],[-0.51875,53.22722],<BR>[-0.53484,53.22819],[-0.53926,53.22850],[-0.53759,53.23366],<BR>[-0.55354,53.25197],[-0.57064,53.23427],[-0.56796,53.23333],<BR>[-0.54251,53.22764],[-0.54796,53.21912],[-0.55416,53.20214],<BR>[-0.56246,53.19333],[-0.57082,53.17395],[-0.67832,53.10239],<BR>[-0.69929,53.07564],[-0.71693,53.11059],[-0.67402,53.21872],<BR>[-0.66818,53.25521],[-0.77575,53.24668],[-0.76478,53.26913],<BR>[-0.75146,53.32024],[-0.56708,53.35294],[-0.54906,53.42575],<BR>[-0.46125,53.42901],[-0.45928,53.43568],[-0.49191,53.49760],<BR>[-0.41390,53.55006],[-0.31045,53.52675],[-0.21935,53.52730],<BR>[-0.21503,53.50638],[-0.20327,53.46674],[-0.12254,53.45489],<BR>[0.02643,53.46201],[0.08385,53.49654],[0.22836,53.40840],<BR>[0.26803,53.34254],[0.30271,53.29408]],[[-0.40406,53.32102],<BR>[-0.41035,53.29527],[-0.42949,53.26455],[-0.36920,53.22594],<BR>[-0.37631,53.20236],[-0.31336,53.18250],[-0.28899,53.17916],<BR>[-0.25398,53.23297],[-0.30694,53.33457],[-0.40406,53.32102]]]};<BR><BR> var
geojson_format = new
OpenLayers.Format.GeoJSON();<BR> var
vector_layer = new
OpenLayers.Layer.Vector();<BR><BR> map.addLayer(vector_layer);<BR><BR>vector_layer.addFeatures(geojson_format.read(test_territory));<BR> }<BR> </script><BR> </head><BR> <body
onload="init()"><BR> <h1 id="title">GeoJSON
Example</h1><BR> <div id="map"
class="smallmap"></div><BR> </body><BR></html><BR><BR></BODY></HTML>