<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=531302721-15072010>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=531302721-15072010></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=531302721-15072010>that's the way I write the SLD from a 
style:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=531302721-15072010></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>function 
SLDwrite(namedLayer)<BR>{<BR>&nbsp;&nbsp;&nbsp; var styleObj = 
map.layers[map.aktLayer]["styleMap"]["styles"]["default"];</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>&nbsp;&nbsp;&nbsp; 
var sld = {};<BR>&nbsp;&nbsp;&nbsp; sld["namedLayers"] = 
{};<BR>&nbsp;&nbsp;&nbsp; sld["namedLayers"][namedLayer] = 
{};<BR>&nbsp;&nbsp;&nbsp; sld["namedLayers"][namedLayer]["userStyles"] = 
[styleObj];<BR>&nbsp;&nbsp;&nbsp; 
sld["namedLayers"][namedLayer]["userStyles"][0].layerName = 
namedLayer;<BR>&nbsp;&nbsp;&nbsp; sld["namedLayers"][namedLayer]["namedStyles"] 
= [];<BR>&nbsp;&nbsp;&nbsp; sld["namedLayers"][namedLayer]["name"] = 
namedLayer;<BR>&nbsp;&nbsp;&nbsp; sld["version"] = "1.0.0";</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>&nbsp;&nbsp;&nbsp; 
var formatSLD = new OpenLayers.Format.SLD();<BR>&nbsp;&nbsp;&nbsp; 
return(formatSLD.write(sld).replace(/\n/g,""));<BR>}<BR></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=531302721-15072010><FONT color=#0000ff 
size=2 face=Arial>Arnd</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Dheeraj 
Chand<BR><B>Gesendet:</B> Donnerstag, 15. Juli 2010 21:36<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Trying to 
troubleshoot a map: redrawing layerwith SLD style<BR></FONT><BR></DIV>
<DIV></DIV>Hi, everyone,
<DIV><BR></DIV>
<DIV>I posted just the other day about a map that I'm building. &nbsp;The idea 
has been changed to a simpler one. &nbsp;Through a form, the user constructs a 
variable that represents the attribute to be considered, then a style is built 
and attached to the layer in question and the layer is redrawn. &nbsp;It should 
be fairly simple, but my newness to JS and OpenLayers is getting in the 
way.</DIV>
<DIV><BR></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Lucida Grande'" class=Apple-style-span>I seem to 
have all kinds of problems with this map,1) For some reason, battlegroundData is 
rendering as a base layer, not an overlay, 2) I think that something is wrong 
with the projection and 3) I'm not sure whether I read the documentation 
correctly for writing the style SLD and then attaching 
it.&nbsp;&nbsp;</SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Lucida Grande'" 
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Lucida Grande'" class=Apple-style-span>Mind 
helping a brother meet his deadline?&nbsp;</SPAN><SPAN 
style="FONT-FAMILY: 'Lucida Grande'" class=Apple-style-span>&nbsp;</SPAN><SPAN 
style="FONT-FAMILY: 'Lucida Grande'" class=Apple-style-span><A 
href="http://gulfcoaststrategicservices.com/maps/lrp/index.html">http://gulfcoaststrategicservices.com/maps/lrp/index.html</A></SPAN></DIV>
<DIV><BR></DIV>
<DIV>Thanks,</DIV>
<DIV><BR></DIV>
<DIV>Dheeraj</DIV></BODY></HTML>