Hi Eric,<div><br></div><div>Thanks for spotting that. I've fixed it but I'm still getting a strange error in Chrome's javascript console:</div><div><br></div><div><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 12px; white-space: pre-wrap; ">Uncaught TypeError: Object function (){var a=null;if(this.baseLayer!=null)a=this.baseLayer.projection;return a} has no method 'getCode'</span><br>
</div><div><span class="Apple-style-span" style="color: rgb(255, 0, 0); font-family: Consolas, 'Lucida Console', monospace; font-size: 12px; line-height: 12px; white-space: pre-wrap; "><br></span></div><div><span class="Apple-style-span" style="font-size: 12px; line-height: 12px; white-space: pre-wrap; "><font class="Apple-style-span" face="arial, helvetica, sans-serif">In the OL script at line 311. Does anyone have a suggestion on a different implementation of a button script?</font></span></div>
<div><span class="Apple-style-span" style="font-size: 12px; line-height: 12px; white-space: pre-wrap; "><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></span></div><div><span class="Apple-style-span" style="font-size: 12px; line-height: 12px; white-space: pre-wrap; "><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br>
</font></span></div><div><div class="gmail_quote">On Sun, Jun 5, 2011 at 4:09 PM, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> var markers = new OpenLayers.Layer.Markers("Markers");var map = new OpenLayers.Map('map');function initGIS(){map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
> var mapnik = new OpenLayers.Layer.OSM();map.addLayer(mapnik); map.setCenter(new OpenLayers.LonLat(-90, 38).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject()),12);<br>
> }<br>
> jQuery(window).ready(function(){jQuery("#btnInit").click(getLoc);});function getLoc(){if (Modernizr.geolocation) { navigator.geolocation.getCurrentPosition(showMap,handle_error);<br>
> } else {yqlgeo.get('visitor',norm_yql_resp);}}<br>
><br>
> function showMap(position){//alert('Lat: ' + position.coords.latitude + ' ' + 'Lon: ' + position.coords.longitude + ' ' + 'Acc: ' + position.coords.accuracy);<br>
> var lonlat = new OpenLayers.LonLat(position.coords.longitude,position.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject);<br>
<br>
</div>map.getProjectionObject -> map.getProjectionObject()<br>
<br>
no?<br>
<br>
--<br>
Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</blockquote></div><br></div>