

/**
 * GeoMashup customization examples 
 * 
 * * The filename must be changed to custom.js for customizations to take effect.
 * * You can edit the examples and enable customizations you want.
 * * If you know javascript, you can add your own customizations using the Google Maps API
 *   documented at http://code.google.com/apis/maps/documentation/reference.html#GMap2
 *
 * Properties
 * A properties object is available in all custom functions, and has these useful
 * variables:
 * * properties.url_path - the URL of the geo-mashup plugin directory
 * * properties.template_url_path - the URL of the active theme directory
 * * properties.map_content - 'global', 'single', or 'contextual'
 * * properties.map_cat     - the category ID of a cateogory map
 *
 * The old custom-marker.js from pre-1.0 versions of Geo Mashup is no longer used.
 */


/**
 * Customize a Geo Mashup map after the relevant content has been loaded.
 *
 * @param properties the properties of the GeoMashup being customized
 * @param map        the Google Map object documented at http://code.google.com/apis/maps/documentation/reference.html#GMap2
 */
 
 
 
function customizeGeoMashupMap ( properties, map ) 
{
		GeoMashup.hideCategory('3');// Opere 2010
		GeoMashup.hideCategory('23'); //opere 2011
		GeoMashup.hideCategory('42'); //performance 2011 
}

/**
 * Provide a custom marker icon by color name. Since multiple categories can
 * be assigned to the same color in the Geo Mashup Options, this can be more
 * efficient than providing individual category icons.
 *
 * @param properties the properties of the GeoMashup object being customized
 * @param color_name the color_name assigned in the Geo Mashup Options
 * @return the custom GIcon
 */
function customGeoMashupColorIcon ( properties, color_name ) {
  var icon = null;
	
	// Make an icon for the color 'lime' from images in the geo-mashup/images directory
	
	/* DELETE this line to enable this example 
  if (color_name == 'fuchsia') {
    icon = new GIcon();
    icon.image = properties.url_path + '/images/my_lime_icon.png';
    icon.shadow = properties.url_path + '/images/my_shadow.png';
    icon.iconSize = new GSize(21, 31);
    icon.shadowSize = new GSize(51, 29);
    icon.iconAnchor = new GPoint(8, 31);
    icon.infoWindowAnchor = new GPoint(8, 1);
  }
	DELETE this line to enable this example */

  return icon;
}

/**
 * Provide a custom marker icon by category names.
 *
 * @param properties the properties of the GeoMashup object being customized
 * @param categories the array of category names assigned to post being marked
 * @return the custom GIcon
 */
function customGeoMashupCategoryIcon ( properties, categories ) {
  var icon = null;
  var iconSize = new GSize(13, 13);
  var iconPos = new GPoint(8, 31);
  var infoWindowPos = new GPoint(12, 0);

	// Make an icon for posts whose first category is 7
	// using images from the current template directory

  if (categories[0] == 3) {
    icon = new GIcon();
    icon.image = properties.template_url_path + '/images/maps/opere.png';
    icon.iconSize = iconSize;
    icon.iconAnchor = iconPos;
    icon.infoWindowAnchor = infoWindowPos;
  }
  if (categories[0] == 4) {
    icon = new GIcon();
    icon.image = properties.template_url_path + '/images/maps/artwhitenight.png';
    icon.iconSize = iconSize;
    icon.iconAnchor = iconPos;
    icon.infoWindowAnchor = infoWindowPos;
  }
  if (categories[0] == 5) {
    icon = new GIcon();
    icon.image = properties.template_url_path + '/images/maps/bolognasirivela.png';
    icon.iconSize = iconSize;
    icon.iconAnchor = iconPos;
    icon.infoWindowAnchor = infoWindowPos;
  }
	// Make an icon for posts assigned to multiple categories
	// using images from the current template directory
	
  if (categories.length > 1) {
  	if(categories[1] == 42){ //Performance
	    icon = new GIcon();
	    icon.image = properties.template_url_path + '/images/maps/opere2.png';
		icon.iconSize = iconSize;
		icon.iconAnchor = iconPos;
		icon.infoWindowAnchor = infoWindowPos;
	}else{
		icon = new GIcon();
		icon.image = properties.template_url_path + '/images/maps/opere.png';
		icon.iconSize = iconSize;
		icon.iconAnchor = iconPos;
		icon.infoWindowAnchor = infoWindowPos;
	}
  }

  return icon;
}

/**
 * Provide a custom marker for single post maps.
 *
 * @param properties the properties of the GeoMashup object being customized
 * @return the custom GIcon
 */
function customGeoMashupSinglePostIcon ( properties ) {
	var icon = null;
  
	// Use the Google 'A' icon instead of the default

	/* DELETE this line to enable this example 
	icon = new GIcon(G_DEFAULT_ICON);
	icon.image = 'http://www.google.com/mapfiles/markerA.png';
	DELETE this line to enable this example */

	return icon;
}
	
/**
 * Provide a custom marker for locations with multiple posts.  The marker icon 
 * already exists when we discover more posts there, so we just change the image. 
 *
 * @param properties the properties of the GeoMashup object being customized
 * @return the custom GIcon
 */
function customGeoMashupMultiplePostImage ( properties, current_image ) {
	var image = null;

	// Replace multiple post icons only when the current image is in the format 
	// my_*.png, where the asterisk can be any letters.

	/* DELETE this line to enable this example 
	if (current_image.search(/my_\w*.png/) >= 0) {
		image = properties.template_url_path + '/images/my_plus.png';
	}
	DELETE this line to enable this example */

  return image;
}



