20120425

simple js geolocation test

Nothing really special here, js Geolocation pulling a static google map image as a very simple example to test some browser settings.  See the code below or run the example here.

You Are Here:<br />
<img id='gmpsimg' />

<script type="text/javascript">
 if (navigator.geolocation) {
  var timeoutVal = 10 * 1000 * 1000;
  navigator.geolocation.getCurrentPosition(
    gmp, 
    showerror,
    { enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 }
  );
 }
 else {
  alert("Geolocation is not supported by this browser");
 }

 function gmp(position) {
  document.getElementById('gmpsimg').src = 
  'http://maps.googleapis.com/maps/api/staticmap?markers=color:blue%7Clabel:X%7C'
  + position.coords.latitude + ',' + position.coords.longitude +
  '&zoom=17&size=400x400&sensor=true&maptype=hybrid';
 }

 function showerror(error) {
  var errors = { 
    1: 'Permission denied',
    2: 'Position unavailable',
    3: 'Request timeout'
  };
  alert("Error: " + errors[error.code]);
 }
</script>

Firefox Feedly RSS option

If you use Firefox with a RSS button and want the default RSS page to offer a Feedly option here is what you need to do: go to the about:c...