spcMapPoint = function(map,item)
{
	this.map = map;
	this.settings = item;
	this.id = item.id;

	this.overlay = this.createMarkerOnMap(item);
	if (!this.overlay)
		return;

	this.overlay.realid = item.id;
}

spcMapPoint.prototype.hide = function()
{
	if (this.overlay)
		this.overlay.setMap(null);
}

spcMapPoint.prototype.show = function()
{
	if (this.overlay)
		this.overlay.setMap(this.map.gmap); // FIXME: test
}

spcMapPoint.prototype.destroy = function()
{
// FIXME: still needed?
//	this.map.gmap.removeOverlay(this.overlay);
}

spcMapPoint.prototype.update = function()
{
	this.setLatLng(this.settings.lat, this.settings.lng);
}

spcMapPoint.prototype.setLatLng = function(lat, lng)
{
	this.overlay.setLatLng(new GLatLng(lat, lng))
}

spcMapPoint.prototype.createMarkerOnMap = function(point)
{
	if (point.lat == undefined || point.long == undefined)
	{
		console.warn('Point '+point.id+' has no lat/long');
		return;
	}			

	var latlng = new google.maps.LatLng(point.lat, point.long);
	
	var allowdragging = this.editmode;

	// add a symbol to the point if it's not published
	var marker;
	// FIXME: reference to a class instance
	if (!point.published)// && !point["volatile"]) // volatile points will never be published
	{
		if (product.config.showunpublished)
		{
			var markericon = this.baseIcons[point.type];
			//var markericon = getClone(this.baseIcons[point.type]);

			markericon.image	= 'gfx/map_icons/'+mapmeta.icon_notpublished.filename;
			markericon.iconSize	= new GSize(mapmeta.icon_notpublished.width, mapmeta.icon_notpublished.height);
			marker = this.createMarker(point.id, mygmap, latlng, markericon, allowdragging);
		}
	}
	else
	{
		//marker = this.map.createMarker(point.id, mygmap, latlng, this.map.baseIcons[point.type], allowdragging);
		marker = this.map.createMarker(point.id, mygmap, latlng, this.map.baseIcons[point.type], allowdragging);
	}

	if (!marker)
		return null;

	return marker;
}
