function LabeledMarker(latlng, opts) {
  this.latlng = latlng;
  this.labelText = opts.labelText || "";
  this.labelClass = opts.labelClass || "map_label";
  this.labelOffset = opts.labelOffset || new GSize(0,0);
  this.minZoom = opts.minZoom || 10;

  GMarker.apply(this, arguments);
}

LabeledMarker.prototype = new GMarker(new GLatLng(0,0));

LabeledMarker.prototype.initialize = function(map) {
  GMarker.prototype.initialize.call(this,map);

  var div = document.createElement("div");
  div.className = this.labelClass;
  div.innerHTML = this.labelText;
  div.style.position = "absolute";

  /*
   * This doesn't work, and the Google API docs says it can't
   * work, but I don't believe them.  Figure it out eventually.
   */

  div.onmouseover = function() {
	this.div.style.zIndex = 0; /* zindex is backwards; need to find highest */
  };

  map.getPane(G_MAP_MARKER_PANE).appendChild(div);
  this.map = map;
  this.div = div;
}

LabeledMarker.prototype.redraw = function(force) {
  GMarker.prototype.redraw.call(this,this.map);
  if(!force)
	return;

  var pixel = this.map.fromLatLngToDivPixel(this.latlng);
  var zindex = GOverlay.getZIndex(this.latlng.lat());
  var zoom_level = this.map.getZoom();

  if (zoom_level <= this.minZoom)
	this.div.style.visibility = "hidden";
  else
	this.div.style.visibility = "visible";

  this.div.style.left = (pixel.x + this.labelOffset.width) + "px";
  this.div.style.top = (pixel.y + this.labelOffset.height) + "px";

  this.div.style.zIndex = zindex + 1;
}

LabeledMarker.prototype.remove = function () {
  this.div.parentNode.removeChild(this.div);
  this.div = null;
  GMarker.prototype.remove.call(this);
}
