﻿
/*_____________________________________________________________________________
Class: MapItem
	name: required
	lat: required
	lng: required
	html: required
	icon: optional, default GIcon(G_DEFAULT_ICON)
*/
var MapItem = Class.create({
	initialize: function(params)
	{
		this.name = params.name;
		this.lat = params.lat;
		this.lng = params.lng;
		//this.html = params.html;
		this.params = params;
		this.id = this.name.replace(/ /, '');
		
		if (params.icon != undefined)
		{
			this.icon = params.icon;
		}
		else
		{
			this.icon = new GIcon(G_DEFAULT_ICON);
		}
		
		this.point = new GLatLng(this.lat, this.lng);
		this.marker = new GMarker(this.point, {icon: this.icon, title: this.name});
		this.window = new CBHInfoWindow(this.id, this.marker, '<h3>' + this.name + '</h3>' + this.html, params.infoClassName);
		
	}
});