panoramio layer (restrict photos by tag)

Restrict photos by tag in a panoramio layer.

function initialize() {
  var mapOptions = {
    zoom: 15,
    center: new google.maps.LatLng(40.693134, -74.031028),
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };

  var map = new google.maps.Map(document.getElementById(\'map-canvas\'),
    mapOptions);

  var panoramioLayer = new google.maps.panoramio.PanoramioLayer();
  panoramioLayer.setMap(map);

  var tag = document.getElementById(\'tag\');
  var button = document.getElementById(\'filter-button\');

  google.maps.event.addDomListener(button, \'click\', function() {
    panoramioLayer.setTag(tag.value);
  });

  map.controls[google.maps.ControlPosition.TOP_CENTER].push(
      document.getElementById(\'filter\'));
}

google.maps.event.addDomListener(window, \'load\', initialize);