Fixed it, just had to mess with the way I was passing the lon-lat to the features.<br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 4:12 PM, Nicholas Efremov-Kendall <span dir="ltr">&lt;<a href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Caught it, it&#39;s a capitalization typo in OpenLayers. However, now the geolocation seems to be off, and there&#39;s no marker...ideas?<div>
<div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 4:07 PM, Nicholas Efremov-Kendall <span dir="ltr">&lt;<a href="mailto:n.e.kendall@gmail.com" target="_blank">n.e.kendall@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi Arnd,</div><div><br></div><div>Thanks for the suggestions and the examples. I&#39;ve been trying to implement the markers on Layer.Vector adapting the code from the example you provided. I haven&#39;t gotten to the point of adding in the conditional statement yet, but I keep getting and error in the show map function at the var = feat line, saying that OpenLayers isn&#39;t defined. Jslint tells me this is because OpenLayers hasn&#39;t been defined yet. Now, I know I&#39;m noob when it comes to syntax, but I&#39;m pretty sure that OL is defined earlier. Do you know what&#39;s going on here?</div>


<div><br></div><div><div>var feat;</div><div>var markers = new OpenLayers.Layer.Vector(&quot;Markers&quot;, {styleMap: new OpenLayers.StyleMap({externalGraphic: &quot;/OpenLayers-2.11-rc1/img/marker.png&quot;})});</div><div>


var map = new OpenLayers.Map(&#39;map&#39;);</div><div>function initGIS(){</div><div><div>map.addControl(new OpenLayers.Control.LayerSwitcher());</div><div>var mapnik = new OpenLayers.Layer.OSM();</div><div>map.addLayer(mapnik);</div>


</div><div>map.setCenter(new OpenLayers.LonLat(-90, 38).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;),map.getProjectionObject()),12);</div><div><div>} </div><div><br></div><div><br></div><div>jQuery(window).ready(function(){jQuery(&quot;#btnInit&quot;).click(getLoc);});</div>


<div>function getLoc(){</div><div>if (Modernizr.geolocation) {</div><div> navigator.geolocation.getCurrentPosition(showMap,handle_error);</div><div>} else {</div><div>yqlgeo.get(&#39;visitor&#39;,norm_yql_resp);</div><div>


}</div><div>}</div><div><br></div><div><br></div><div>function showMap(position)</div><div>{</div><div>//var lonlat = new OpenLayers.LonLat(position.coords.longitude,position.coords.latitude).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;),map.getProjectionObject());</div>


<div>map.addLayer(markers);</div></div><div>var feat = new Openlayers.LonLat(position.coords.longitude,position.coords.latitude).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;),map.getProjectionObject());</div>

<div>markers.addFeatures([newFeature(feat)]);</div><div><div></div><div>
<div>var bounds = markers.getDataExtent();</div><div>map.zoomToExtent(bounds);</div><div>}</div><div><br></div><div>function handle_error(error) {</div><div>switch(error.code){</div><div>case error.PERMISSION_DENIED: alert(&quot;This application reguires you to agree to share your location. Please reload the page to see it work properly. There is a privacy disclaimer at the bottom of this page. This site does not currently record or store these data, and in the future will not record unique user information without informing the user or asking their permission. -Virtual Spatiality&quot;);</div>


<div>break;</div><div>  </div><div>case error.POSITION_UNAVAILABLE: alert(&quot;could not determine position&quot;);</div><div>break;</div><div>  </div><div>case error.TIMEOUT: alert(&quot;timeout retrieving position&quot;);</div>


<div>break;</div><div>  </div><div>default: alert(&quot;unknown error&quot;);</div><div>break;</div><div>}</div><div>}</div><div><br></div><div>function norm_yql_resp(response){</div><div><span style="white-space:pre-wrap">        </span>if (response.error) {</div>


<div><span style="white-space:pre-wrap">                </span>var error = {code : 0};</div><div><span style="white-space:pre-wrap">                </span>handle_error(error);</div><div><span style="white-space:pre-wrap">                </span>return;</div>
<div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">                </span>var position = {</div><div><span style="white-space:pre-wrap">                        </span>coords:</div>
<div><span style="white-space:pre-wrap">                        </span>{</div><div><span style="white-space:pre-wrap">                                </span>latitude: response.place.centroid.latitude,</div><div><span style="white-space:pre-wrap">                                </span>longitude: response.place.centroid.longitude</div>


<div><span style="white-space:pre-wrap">                        </span>},</div><div><span style="white-space:pre-wrap">                        </span>address :</div><div><span style="white-space:pre-wrap">                        </span>{</div>
<div><span style="white-space:pre-wrap">                                </span>city: response.place.locality2.content,</div><div><span style="white-space:pre-wrap">                                </span>region: response.place.admin1.content,</div>
<div><span style="white-space:pre-wrap">                                </span>country: response.place.country.content</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>};</div>
<div><span style="white-space:pre-wrap">                </span>handle_geolocation_query(position);</div><div>}</div></div></div><div>function newFeature(feat){</div><div>var ptn = new OpenLayers.Geometry.Point(feat);</div><div>var ptnFeat = new OpenLayers.Feature.Vector(ptn,null,null);</div>


<div>return(ptnFeat);</div><div>}</div></div><div><div></div><div><div><br></div><div><br></div><br><div class="gmail_quote">On Mon, Jun 13, 2011 at 2:13 AM, Arnd Wippermann <span dir="ltr">&lt;<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span>if you use Feature.Vector markers to display your 
markers, try</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span></span></font><font color="#0000ff" size="2" face="Arial"><span></span></font> </div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span>if(vectorLayer.features.length&gt;0)</span></font></div>
<div dir="ltr" align="left"><font face="Arial"><font color="#0000ff"><font size="2"><span>    
</span>vectorLayer.removeFeatures(vectorLayer.features);</font></font></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"></font> </div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial">
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span>to remove the marker before you add a marker at the new 
position.</span></font></div></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><a href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/Map_mit_Marker.asp" target="_blank">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/Map_mit_Marker.asp</a></font></div>


<font color="#0000ff" size="2" face="Arial"></font><font color="#0000ff" size="2" face="Arial"></font><font color="#0000ff" size="2" face="Arial"></font>
<div><br><span><font color="#0000ff" size="2" face="Arial">or 
use a DragFeature.Control to drag the marker around.</font></span></div>
<div><span><font color="#0000ff" size="2" face="Arial"></font></span><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" size="2" face="Arial"><a href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/gc_example.html" target="_blank">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/gc_example.html</a></font></span></div>



<div><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" size="2" face="Arial"> Or both.</font></span></div>
<div><span></span> </div>
<div><span><font color="#0000ff" size="2" face="Arial">i was 
not able to update the position of the marker by updating the geometry and 
redraw the feature. The label moves to the new position, but the marker (the 
externalGraphic) wouldn&#39;t move!?</font></span></div>
<div><span><font color="#0000ff" size="2" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" size="2" face="Arial">Arnd</font></span></div><pre> </pre>
<div><font color="#0000ff" size="2" face="Arial"></font> </div>
<div><font color="#0000ff" size="2" face="Arial"></font> </div>
<div dir="ltr" lang="de" align="left">
<hr>
<font size="2" face="Tahoma"><b>Von:</b> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a> 
[mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>] <b>Im Auftrag von </b>Nicholas 
Efremov-Kendall<br><b>Gesendet:</b> Samstag, 11. Juni 2011 18:43<br><b>An:</b> 
Rossko<br><b>Cc:</b> <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a><br><b>Betreff:</b> Re: 
[OpenLayers-Users] Re: help with removing/replacing a markerafter click 
event<br></font><br></div><div><div></div><div>
<div></div>Hi Rosco,
<div><br></div>
<div>No, I hadn&#39;t thought of that. Any suggestions on how to update the position 
of the marker, maybe a loop with a new LonLat?<br><br>
<div class="gmail_quote">On Sat, Jun 11, 2011 at 5:00 AM, Rossko <span dir="ltr">&lt;<a href="mailto:rossko@culzean.clara.co.uk" target="_blank">rossko@culzean.clara.co.uk</a>&gt;</span> 
wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
  <div>&gt; The issue is that each time the user clicks, another marker 
  is placed. This<br>isn&#39;t really a problem, but for<br>&gt; aesthetic purposes, 
  I&#39;d like to destroy or remove the first marker if the<br>&gt; clicks 
  again<br><br></div>Have you considered a different approach to coding this, 
  create one marker<br>and move it around.<br><font color="#888888"><br>--<br>View 
  this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html</a><br>


Sent 
  from the OpenLayers Users mailing list archive at 
  Nabble.com.<br>_______________________________________________<br>Users 
  mailing list<br><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>


</font></blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>