<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.webkit-javascript-keyword
        {mso-style-name:webkit-javascript-keyword;}
span.webkit-javascript-ident
        {mso-style-name:webkit-javascript-ident;}
span.webkit-block-start
        {mso-style-name:webkit-block-start;}
span.webkit-javascript-string
        {mso-style-name:webkit-javascript-string;}
span.webkit-javascript-number
        {mso-style-name:webkit-javascript-number;}
span.webkit-javascript-comment
        {mso-style-name:webkit-javascript-comment;}
span.webkit-block-end
        {mso-style-name:webkit-block-end;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I wanted to create a map like this  <a href="http://openlayers.org/dev/examples/mobile-jq.html#mappage">
http://openlayers.org/dev/examples/mobile-jq.html#mappage</a> using JqueryMobile and OpenLayers but I wanted to add features using the click handler like in this example  <a href="http://openlayers.org/dev/examples/click.html">http://openlayers.org/dev/examples/click.html</a>
 but when  I activate my click handler to add features coded thusly <span style="font-size:12.0pt;font-family:"Arial","sans-serif"">
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">function</span><span style="font-size:9.0pt;font-family:Consolas;color:black"> createFeature(theName, theNote, theLocal){<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">    </span><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">var</span><span style="font-size:9.0pt;font-family:Consolas;color:black">
 observationLayer = map.getLayersByName(</span><span style="font-size:9.0pt;font-family:Consolas;color:#C41A16">"customFeatures"</span><span style="font-size:9.0pt;font-family:Consolas;color:black">)[</span><span style="font-size:9.0pt;font-family:Consolas;color:#1C00CF">0</span><span style="font-size:9.0pt;font-family:Consolas;color:black">];</span><span style="font-size:9.0pt;font-family:Consolas;color:#007400">//getLayersByName
</span><span style="font-size:9.0pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">    </span><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">var</span><span style="font-size:9.0pt;font-family:Consolas;color:black">
 point = </span><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">new</span><span style="font-size:9.0pt;font-family:Consolas;color:black"> OpenLayers.Geometry.Point(theLocal.x,theLocal.y);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">   
</span><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">var</span><span style="font-size:9.0pt;font-family:Consolas;color:black"> pointFeature =
</span><span style="font-size:9.0pt;font-family:Consolas;color:#AA0D91">new</span><span style="font-size:9.0pt;font-family:Consolas;color:black"> OpenLayers.Feature.Vector(point);
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">    pointFeature.attributes={
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">        name: theName,<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">        point:theLocal,
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">        note:theNote<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">        };<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">    observationLayer.addFeatures([pointFeature]);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">   
</span><span style="font-size:9.0pt;font-family:Consolas;color:#007400">// note, the marker icon for this point is declared in the styleMap of the customFeatures layer
</span><span style="font-size:9.0pt;font-family:Consolas;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:10.5pt;background:white"><span style="font-size:9.0pt;font-family:Consolas;color:black">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial","sans-serif"">What might I be doing wrong. How do I debug this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Nehemiah I. Dacres<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Consultant, Booz Allen Hamilton<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>