MarcarUnicoPunto = function(map,urlIcono) {

	this.init(map,urlIcono);
}

jQuery.extend(MarcarUnicoPunto.prototype, {
	
	map: null,
	
	layer: null,
	
	icono: null,

	init: function(map,urlIcono){

		this.map = map;
		this.layer = new OpenLayers.Layer.Markers("",{"displayInLayerSwitcher":false});
		this.map.addLayer(this.layer);
		this.layer.setZIndex(this.map.Z_INDEX_BASE['Popup'] - 1);
		size = new OpenLayers.Size(13,22);
		offset = new OpenLayers.Pixel(-(size.w)/2, -size.h);
		this.icono = new OpenLayers.Icon(urlIcono,size,offset);
	},
	
	marcarPunto: function(lon,lat){
		
		this.layer.clearMarkers();
		ll = new OpenLayers.LonLat(lon,lat);
		ll.transform(new OpenLayers.Projection("WGS84"),
				     new OpenLayers.Projection("EPSG:900913"));
		this.layer.addMarker(new OpenLayers.Marker(ll,this.icono));
		this.map.setCenter(ll,13);
	},
	
	senalizarPunto: function(lon,lat){
		
		this.layer.clearMarkers();
		ll = new OpenLayers.LonLat(lon,lat);
		ll.transform(new OpenLayers.Projection("WGS84"),
				     new OpenLayers.Projection("EPSG:900913"));
		this.layer.addMarker(new OpenLayers.Marker(ll,this.icono));
	},
	
	marcarWKT: function(wkt){
		
		this.layer.clearMarkers();
		parser = new OpenLayers.Format.WKT();
		fea = parser.read(wkt);
		ll = new OpenLayers.LonLat(fea.geometry.x,fea.geometry.y);
		ll.transform(new OpenLayers.Projection("EPSG:23029"),
				     new OpenLayers.Projection("EPSG:900913"));
		this.layer.addMarker(new OpenLayers.Marker(ll,this.icono));
	},
	
	borrarMarcas: function(){
		
		this.layer.clearMarkers();
	}
});
