var markerCluster;
function getParadasPuntos(){//modifica markerArray para aņadir todos los puntos.
	var url = '/coordenadasporactividade.php';
	var agrupar = $('#agrupar_geo').val();
	url = url + "?actividade="+escape($('#actividades_geo').val())+"&clasificacion="+escape($('#clasificacion_geo').val());
	map.clearOverlays();
	var bounds = new GLatLngBounds();
	datoscomercios = $.get(url,'',function(transport){
		paradas = transport.split("\n");
		markerArray.length = 0; //Quick&dirty vaciado
		$.each(paradas,function(j,item){
			var datosPunto = item.split("\t");
			latitud = datosPunto[1];
			longitud = datosPunto[2];
			var punto = new GLatLng(latitud, longitud);
			if (latitud){
				bounds.extend(punto);
				func_marker = new GMarker(punto);
				func_marker = createStoreMarker(punto, datosPunto[3], datosPunto[0]);
				markerArray.push(func_marker);
				if (agrupar == 0){
					map.addOverlay(func_marker);
				}
			}
		});
		if ($('#centrar_geo').is(':checked')){
			map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
		}
		if (markerCluster){
			markerCluster.clearMarkers();
		}
		if (agrupar == 1){
			markerCluster = new MarkerClusterer(map, markerArray);
		}
		//map.setZoom(14);
	},'text');
}


function getDatosPunto(marker, nombre, id){
	if (id){
		cargar_ajax('/?accion=verlistado_ajax&tipo=single&empresasid='+id, id);

	}
}
function activarSingle(id){
	activarDetalle(0,id);
}