// A TextualPanLeftControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).
function TextualPanLeftControl() {
}
TextualPanLeftControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualPanLeftControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var panLeftDiv = document.createElement("img");
  panLeftDiv.src = "http://tunewiki.com/wiki/android/images/map_left.png";
  container.appendChild(panLeftDiv);
  GEvent.addDomListener(panLeftDiv, "click", function() {
    map.panDirection(1,0);
  });


  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualPanLeftControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(2, 150));
}

function TextualPanRightControl() {
}
TextualPanRightControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualPanRightControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var panRightDiv = document.createElement("img");
  panRightDiv.src = "http://tunewiki.com/wiki/android/images/map_right.png";
  container.appendChild(panRightDiv);
  GEvent.addDomListener(panRightDiv, "click", function() {
    map.panDirection(-1,0);
  });


  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualPanRightControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(2, 150));
}


function TextualPanUpControl() {
}
TextualPanUpControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualPanUpControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var panUpDiv = document.createElement("img");
  panUpDiv.src = "http://tunewiki.com/wiki/android/images/map_up.png";
  container.appendChild(panUpDiv);
  GEvent.addDomListener(panUpDiv, "click", function() {
    map.panDirection(0,1);
  });


  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualPanUpControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(125, 2));
}

function TextualPanDownControl() {
}
TextualPanDownControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextualPanDownControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var panDownDiv = document.createElement("img");
  panDownDiv.src = "http://tunewiki.com/wiki/android/images/map_down.png";
  container.appendChild(panDownDiv);
  GEvent.addDomListener(panDownDiv, "click", function() {
    map.panDirection(0,-1);
  });


  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextualPanDownControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(125, -2));
}

function TextualZoomInControl() {
 }
 TextualZoomInControl.prototype = new GControl();
 
 TextualZoomInControl.prototype.initialize = function(map) {
   var container = document.createElement("div");
 
   var zoomInDiv = document.createElement("img");
   zoomInDiv.src = "http://tunewiki.com/wiki/android/images/map_in.png";
   container.appendChild(zoomInDiv);
   GEvent.addDomListener(zoomInDiv, "click", function() {
     map.zoomIn();
   }); 
 
   map.getContainer().appendChild(container);
   return container;
 }
 
 // By default, the control will appear in the top left corner of the
 // map with 7 pixels of padding.
 TextualZoomInControl.prototype.getDefaultPosition = function() {
   return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
 }

function TextualZoomOutControl() {
 }
 TextualZoomOutControl.prototype = new GControl();
 
 TextualZoomOutControl.prototype.initialize = function(map) {
   var container = document.createElement("div");
 
   var zoomOutDiv = document.createElement("img");
   zoomOutDiv.src = "http://tunewiki.com/wiki/android/images/map_out.png";
   container.appendChild(zoomOutDiv);
   GEvent.addDomListener(zoomOutDiv, "click", function() {
     map.zoomOut();
   });
 
   map.getContainer().appendChild(container);
   return container;
 }
 
 // By default, the control will appear in the top left corner of the
 // map with 7 pixels of padding.
 TextualZoomOutControl.prototype.getDefaultPosition = function() {
   return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 40));
 }

