Google Maps getCoordinates

By Matt Claypotch Last update Sep 3, 2008 — Installed 191 times. Daily Installs: 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// ==UserScript==
// @name           gmailCoordinates
// @namespace      http://www.geekyneighbor.com/
// @description    Adds "Get Coordinates" link to Google Maps
// @include        http://maps.google.com/*
// ==/UserScript==

//window.addEventListener("load", function(){setTimeout(Main,200);}, false) ;
window.addEventListener("load", function () {
  var bar = document.getElementById("panel");
  bar = bar.getElementsByTagName("span");
  bar = bar[0];

  // Create and insert Spacer
  var spacerText = document.createTextNode(" | ");
  bar.appendChild(spacerText);

  var showLink = document.createElement("a");
  // Embed javascript functionality (rather than bookmarklet)
  showLink.setAttribute("href", "javascript:void(prompt('',gApplication.getMap().getCenter()));");
  showLink.setAttribute("id",   "c_launch");

  var showLinkTextSpan = document.createElement("span");
  var showLinkText = document.createTextNode("Get Coordinates");

  showLinkTextSpan.appendChild(showLinkText);
  showLink.appendChild(showLinkTextSpan);

  bar.appendChild(showLink);

  var showLinkSel = document.createElement("a");
  showLinkSel.setAttribute("id",    "c_launchsel"   );
  showLinkSel.setAttribute("class", "launchsel"     );
  showLinkSel.setAttribute("style", "display: none;");
  showLinkSel.setAttribute("href",  "#"             );
  
  var showLinkSelText = document.createTextNode("Get Coordinates");
  showLinkSel.appendChild(showLinkSelText);
  
  bar.appendChild(showLinkSel);
}, false) ;